Fix pretty printing of record types

This commit is contained in:
Justin Ethier 2021-02-03 17:43:26 -05:00
parent cfd7512b9a
commit 9447dc9b05
2 changed files with 8 additions and 2 deletions

View file

@ -6,6 +6,10 @@ Features
- Enhanced `c-define` to emit type checks for parameters.
Bug Fixes
- Allow `pretty-print` to display contents of a record type.
## 0.25 - January 25, 2021
Features

View file

@ -83,7 +83,9 @@
(cond ((pair? obj) (wr-expr obj col))
((null? obj) (wr-lst obj col))
((vector? obj) (wr-lst (vector->list obj) (out "#" col)))
((or (vector? obj)
(record? obj))
(wr-lst (vector->list obj) (out "#" col)))
((bytevector? obj) (wr-lst
(map char->integer (string->list (utf8->string obj)))
(out "#u8" col)))
@ -134,7 +136,7 @@
(spaces (- to col) col))))
(define (pr obj col extra pp-pair)
(if (or (pair? obj) (vector? obj)) ; may have to split on multiple lines
(if (or (pair? obj) (vector? obj) (record? obj)) ; may have to split on multiple lines
(let ((result '())
(left (min (+ (- (- width col) extra) 1) max-expr-width)))
(generic-write obj display? #f