Thanks, that's the way to go.
Am Montag, 10. September 2012 schrieb Carl Eastlund:
> The following expression should do what you want:
>
> (+ (string->number "1.2") 1)
>
> If you're starting from a symbol, use symbol->string before string->number.
>
> Carl Eastlund
>
> On Mon, Sep 10, 2012 at 12:4
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.
Carl Eastlund
On Mon, Sep 10, 2012 at 1:19 PM, Gregory Woodhouse wrote:
> Is there a similar function fo
Is there a similar function for characters? I.e., one that will map #\1 to 1?
Sent from my iPhone
On Sep 10, 2012, at 9:44 AM, Carl Eastlund wrote:
> The following expression should do what you want:
>
> (+ (string->number "1.2") 1)
>
> If you're starting from a symbol, use symbol->string bef
The following expression should do what you want:
(+ (string->number "1.2") 1)
If you're starting from a symbol, use symbol->string before string->number.
Carl Eastlund
On Mon, Sep 10, 2012 at 12:41 PM, Nikolaus Klepp wrote:
> Hi all,
>
> In tinyscheme I can do this:
>
> > (+ (string->symbol
Hi all,
In tinyscheme I can do this:
> (+ (string->symbol "1.2") 1)
2.2
In racket that does not work, because
> (string->symbol "1.2")
'|1.2|
which is not a number. I can use this workaround:
> (+ (read (open-input-string "1.2")) 1)
2.2
But is there a clean way to get the above line from
5 matches
Mail list logo