Inverse function of string

For the Compleat Fan
Locked
HJH
Posts: 21
Joined: Tue May 31, 2005 2:21 pm
Location: Europe

Inverse function of string

Post 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

Sammo
Posts: 180
Joined: Sat Dec 06, 2003 6:11 pm
Location: Loveland, Colorado USA

Post 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

Locked