<html><head></head><body bgcolor="#FFFFFF"><div>Is there a similar function for characters? I.e., one that will map #\1 to 1?<br><br>Sent from my iPhone</div><div><br>On Sep 10, 2012, at 9:44 AM, Carl Eastlund <<a href="mailto:cce@ccs.neu.edu">cce@ccs.neu.edu</a>> wrote:<br><br></div><div></div><blockquote type="cite"><div>The following expression should do what you want:<br><br>(+ (string->number "1.2") 1)<br><br>If you're starting from a symbol, use symbol->string before string->number.<br><br clear="all">Carl Eastlund<br>
<br><div class="gmail_quote">On Mon, Sep 10, 2012 at 12:41 PM, Nikolaus Klepp <span dir="ltr"><<a href="mailto:dr.klepp@gmx.at" target="_blank">dr.klepp@gmx.at</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br>
<br>
In tinyscheme I can do this:<br>
<br>
> (+ (string->symbol "1.2") 1)<br>
2.2<br>
<br>
In racket that does not work, because<br>
<br>
> (string->symbol "1.2")<br>
'|1.2|<br>
<br>
which is not a number. I can use this workaround:<br>
<br>
> (+ (read (open-input-string "1.2")) 1)<br>
2.2<br>
<br>
But is there a clean way to get the above line from tinyscheme working on<br>
racket without that workaround?<br>
<br>
Nik<br><br></blockquote></div>
</div></blockquote><blockquote type="cite"><div><span>____________________</span><br><span> Racket Users list:</span><br><span> <a href="http://lists.racket-lang.org/users">http://lists.racket-lang.org/users</a></span><br></div></blockquote></body></html>