Next: baselib characters, Previous: baselib lists, Up: baselib [Index]
Symbols are objects whose usefulness rests on the fact that two 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 #t
if the symbols are the same, i.e., if their names are
spelled the same.
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