Thank you!<br><br><div class="gmail_quote">On Mon, May 17, 2010 at 10:42 AM, Danny Yoo <span dir="ltr"><<a href="mailto:dyoo@cs.wpi.edu">dyoo@cs.wpi.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">> Is there an easy way to convert a string like this -- "(a or (b and c))" --<br>
> to a list-of-symbols equivalent to '(a or (b and c)) ?<br>
> (string->symbol "(a or (b and c))" returns '|(a or (b and c))|" .<br>
<br>
</div>You can use read, which knows how to consume the content of an input<br>
port, in combination with open-input-string, which knows how to turn<br>
a string into an input port.<br>
<br>
<a href="http://docs.plt-scheme.org/reference/Reading.html?q=read#(def._((quote._~23~25kernel)._read))" target="_blank">http://docs.plt-scheme.org/reference/Reading.html?q=read#(def._((quote._~23~25kernel)._read))</a><br>
<br>
<a href="http://docs.plt-scheme.org/reference/stringport.html?q=open-input-string#(def._((quote._~23~25kernel)._open-input-string))" target="_blank">http://docs.plt-scheme.org/reference/stringport.html?q=open-input-string#(def._((quote._~23~25kernel)._open-input-string))</a><br>
<div class="im"><br>
<br>
<br>
> What do<br>
> the the vertical lines which book-end the output value signify?<br>
<br>
</div>The default writer is introducing those bars as a way of saying "this<br>
is a symbol, but there's enough funny characters that I'll delimit it<br>
for you." The gory details on when this happens are in the section:<br>
<br>
<a href="http://docs.plt-scheme.org/reference/printing.html?q=writer&q=open-input-string" target="_blank">http://docs.plt-scheme.org/reference/printing.html?q=writer&q=open-input-string</a><br>
</blockquote></div><br>