Page 1 of 1

Inverse function of string

Posted: Wed Jun 01, 2005 3:23 pm
by HJH
Hi

what is the inverse function of string.

Code: Select all

(string 'hello)
gives back

Code: Select all

"hello"
.

If I have a string how do I get a corresponding atom assuming the atom has no spaces.

A note (or link) in the documentation under the entry string would be helpful.

A similar question: how do I test strings for equality?


Thank you for the answer in advance.

HJH

Posted: Wed Jun 01, 2005 4:34 pm
by Sammo
Hello HJH,

(symbol "hello") --> hello
(sym "hello") --> hello
(symbol "Hello") --> Hello
(sym "Hello") --> Hello

The symbols 'hello' and 'Hello' are distinct. The names 'sym' and 'symbol' are two ways of specifying the same function.

(= "hello" "hello") --> true
(= "hello" "Hello") --> nil

-- Sam