[racket] Conversion of sexprs to strings?

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Mon Jun 20 14:04:29 EDT 2011

Kazimir Majorinc wrote at 06/20/2011 01:51 PM:
> Is there some built in like write-to-string in some dialects, or some 
> trick to avoid writing my own "code walker"?
>
> R5RS or R6RS if possible.

For R5RS, you will want to add SRFI-6 to do this (you should always add 
SRFI-23 and SRFI-6 to R5RS), and then just use the "write" procedure to 
write to the output-string output-port.

That also happens to be a good way to do it in Racket, unless you want 
to use the very nice Racket pretty-printer.

-- 
http://www.neilvandyke.org/


Posted on the users mailing list.