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>