Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

number symbols from strings in scheme

Name: Anonymous 2013-06-17 8:39

yo'
stop talking about the jews for a moment and help me, thanks.

I'm toying with scheme evaluator and I'd like to know why the conversion from string to symbol, lets say (string->symbol "1"),
returns things as |1| and not '1 that eval or the language itself would recognize as a number.

Name: Anonymous 2013-06-17 8:42

>>1
http://en.wikipedia.org/wiki/Strong_typing
The Lisp family of languages are all "strongly typed" in the sense that typing errors are prevented at runtime. Some Lisp dialects like Common Lisp or Clojure do support various forms of type declarations[9] and some compilers (CMUCL[10] and related) use these declarations together with type inference to enable various optimizations and also limited forms of compile time type checks.

Name: Anonymous 2013-06-17 8:44

>>2
epic!!!!!!

Name: Anonymous 2013-06-17 8:45

the number 1 isn't the same thing as a symbol whose name is "1"

further example: 1a is a syntax error but you can still have a symbol named "1a"

Name: Anonymous 2013-06-17 9:07

>>2
Good read

>>4
Ok, I think I follow.
So if I want to parse numbers from strings there's no elegant way, just getting my hands dirty with splitting or with a external library?

Well, thanks.

Name: Anonymous 2013-06-17 9:25

>>5
quit trolling.

Name: Anonymous 2013-06-17 9:36

>>6
This is probably bait but just in case since I'm curious I'll give you the benefit of the doubt.

My question was genuine, could you tell me why you think I'm trolling?

Name: Anonymous 2013-06-17 9:41

>>7
Nevermind (string->number)
I'm fucking stupid, sorry.

Name: Anonymous 2013-06-17 20:32

Name: Anonymous 2013-06-17 20:37


Don't change these.
Name: Email:
Entire Thread Thread List