[racket] print-graph, DrRacket, and command-line REPL

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Wed Oct 13 08:48:03 EDT 2010

In 5.0.1, how do I make REPL printing in both DrRacket Interactions and 
the command-line REPL use the shared structure format?

In DrRacket, I cannot seem to do this regardless of whether the "Show 
sharing in values" is true, and whether "Output Style" is "write" or 

 > (print-graph #t) ; just to show that this does not seem to affect the 
 > (define x (let ((tail '(tail))) `((a , at tail) (b , at tail))))
 > x
((a tail) (b tail))
 > (parameterize ((print-graph #t)) (format "~S" x))
"((a . #0=(tail)) (b . #0#))"

I want to see the shared structure format, since I have some library 
code that uses shared list tails heavily to save space and to shortcut 
some searches.

I believe that PLT 3xx, at least, used shared structure format by default.


Posted on the users mailing list.