[plt-scheme] String -> listof symbols

From: Danny Yoo (dyoo at cs.wpi.edu)
Date: Mon May 17 13:42:50 EDT 2010

> Is there an easy way to convert a string like this -- "(a or (b and c))" --
>  to a list-of-symbols equivalent to '(a or (b and c)) ?
> (string->symbol "(a or (b and c))" returns '|(a or (b and c))|" .

You can use read, which knows how to consume the content of an input
port,  in combination with open-input-string, which knows how to turn
a string into an input port.



> What do
> the the vertical lines which book-end the output value signify?

The default writer is introducing those bars as a way of saying "this
is a symbol, but there's enough funny characters that I'll delimit it
for you."  The gory details on when this happens are in the section:


Posted on the users mailing list.