There is char->integer, but it produces the character's number in Unicode, so #\1 would not map to 1. You may be best off in that case with (string->number (string ch)) for any character ch.<br><br clear="all">Carl Eastlund<br>
<br><div class="gmail_quote">On Mon, Sep 10, 2012 at 1:19 PM, Gregory Woodhouse <span dir="ltr"><<a href="mailto:gregwoodhouse@me.com" target="_blank">gregwoodhouse@me.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div 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><div class="h5"><div><br>On Sep 10, 2012, at 9:44 AM, Carl Eastlund <<a href="mailto:cce@ccs.neu.edu" target="_blank">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></div></div><div class="im"><blockquote type="cite"><div><span>____________________</span><br><span> Racket Users list:</span><br><span> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a></span><br>
</div></blockquote></div></div>
</blockquote></div><br>