How to print structures in PLT Scheme so as to display their fields?

Posted by tkf on Stack Overflow See other posts from Stack Overflow or by tkf
Published on 2010-02-02T05:24:48Z Indexed on 2010/05/18 15:50 UTC
Read the original article Hit count: 192

I would like code like this:

(define-struct thing (a b c))
(define th (make-thing 1 2 3))

to print something like this:

(make-thing 1 2 3)

when I type "th" into either the DrScheme or MzScheme repl. I am using the language "pretty big" in DrScheme with output style set to "constructor". This is what I get in DrScheme:

(make-thing ...)

(i literally get the three dots)

In MzScheme:

#<thing>

© Stack Overflow or respective owner

Related posts about plt-scheme

Related posts about data-structures