Next: Namespaces and compound symbols, Up: Symbols and namespaces [Contents][Index]
Simple symbols have no properties other than their name, an immutable string.
They have the useful property that two simple symbols
are identical (in the sense of eq?
, eqv?
and
equal?
) if and only if their names are spelled the same way. A
symbol literal is formed using quote
.
Return #t
if obj is a symbol, #f
otherwise.
(symbol? 'foo) ⇒ #t (symbol? (car '(a b))) ⇒ #t (symbol? "bar") ⇒ #f (symbol? 'nil) ⇒ #t (symbol? '()) ⇒ #f (symbol? #f) ⇒ #f
Return the name of symbol as an immutable string.
(symbol->string 'flying-fish) ⇒ "flying-fish" (symbol->string 'Martin) ⇒ "Martin" (symbol->string (string->symbol "Malvina")) ⇒ "Malvina"
Return the symbol whose name is string.
(eq? 'mISSISSIppi 'mississippi) ⇒ #f (string->symbol "mISSISSIppi") ⇒ the symbol with name "mISSISSIppi" (eq? 'bitBlt (string->symbol "bitBlt")) ⇒ #t (eq? 'JollyWog (string->symbol (symbol->string 'JollyWog))) ⇒ #t (string=? "K. Harper, M.D." (symbol->string (string->symbol "K. Harper, M.D."))) ⇒ #t
Next: Namespaces and compound symbols, Up: Symbols and namespaces [Contents][Index]