Fixing confusing printing from Arjun

This commit is contained in:
Jay McCarthy 2010-09-06 17:03:16 -06:00
parent 4e757e07fc
commit f440332768
2 changed files with 9 additions and 1 deletions

View File

@ -142,7 +142,7 @@
#:reflection-name 'variant) #:reflection-name 'variant)
... ...
(define variant? (define variant?
(flat-named-contract 'variant? variant*?)) variant*?)
... ...
(define (datatype? x) (define (datatype? x)
(or (variant? x) ...)) (or (variant? x) ...))

View File

@ -17,6 +17,14 @@
(set! success (add1 success)) (set! success (add1 success))
(error 'check "failed: ~s vs. ~s" a b))) (error 'check "failed: ~s vs. ~s" a b)))
(check (to-string print Foo?) "#<procedure:Foo?>")
(check (to-string write Foo?) "#<procedure:Foo?>")
(check (to-string display Foo?) "#<procedure:Foo?>")
(check (to-string print bar?) "#<procedure:bar?>")
(check (to-string write bar?) "#<procedure:bar?>")
(check (to-string display bar?) "#<procedure:bar?>")
(check (to-string print (bar "a" 'b)) "(bar \"a\" 'b)") (check (to-string print (bar "a" 'b)) "(bar \"a\" 'b)")
(check (to-string write (bar "a" 'b)) "#(struct:bar \"a\" b)") (check (to-string write (bar "a" 'b)) "#(struct:bar \"a\" b)")
(check (to-string display (bar "a" 'b)) "#(struct:bar a b)") (check (to-string display (bar "a" 'b)) "#(struct:bar a b)")