Don't wrap booleans, print typed values
This commit is contained in:
parent
d678e7657d
commit
08ca97bf9e
|
@ -5,14 +5,16 @@
|
||||||
(define-struct any-wrap (val)
|
(define-struct any-wrap (val)
|
||||||
#:property prop:custom-write
|
#:property prop:custom-write
|
||||||
(lambda (v p write?)
|
(lambda (v p write?)
|
||||||
(fprintf p "#<Typed Value>")))
|
(fprintf p "#<Typed Value: ~a>" (any-wrap-val v))))
|
||||||
|
|
||||||
(define (traverse wrap?)
|
(define (traverse wrap?)
|
||||||
(define (t v)
|
(define (t v)
|
||||||
(match v
|
(match v
|
||||||
[(? (lambda (e) (and (any-wrap? e) (not wrap?)))) (any-wrap-val v)]
|
[(? (lambda (e) (and (any-wrap? e) (not wrap?)))) (any-wrap-val v)]
|
||||||
[(? (lambda (e)
|
[(? (lambda (e)
|
||||||
(or (number? e) (string? e) (char? e) (symbol? e) (keyword? e) (bytes? e) (void? e)))) v]
|
(or (number? e) (string? e) (char? e) (symbol? e)
|
||||||
|
(keyword? e) (bytes? e) (boolean? e) (void? e))))
|
||||||
|
v]
|
||||||
[(cons x y) (cons (t x) (t y))]
|
[(cons x y) (cons (t x) (t y))]
|
||||||
[(and (? immutable?) (? vector?)) (vector-map t v)]
|
[(and (? immutable?) (? vector?)) (vector-map t v)]
|
||||||
[(and (? immutable?) (box v)) (box (t v))]
|
[(and (? immutable?) (box v)) (box (t v))]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user