[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5 Symbols

Builtin Class: <symbol>
A class for symbols.

In Gauche, all symbols are interned, i.e. two symbols with the same print name are always eq?.

Reader Syntax: |name|
Denotes a symbol that has weird name, i.e. the name including the characters which is not allowed in the R5RS symbol syntax. If the interpreter is running in case-insensitive mode, this syntax can be used to include uppercase characters in a symbol (See section 2.3 Case-sensitivity).

The syntax is taken from CommonLisp. Some other Scheme implementation use it as well.

Function: symbol? obj
[R5RS] Returns true if and only if obj is a symbol.
(symbol? 'abc)     => #t
(symbol? 0)        => #f
(symbol? 'i)       => #t
(symbol? '-i)      => #f
(symbol? '|-i|)    => #t

Function: symbol->string symbol
[R5RS] Returns the name of symbol in a string. Returned string is immutable.

(symbol->string 'foo) => foo

Function: string->symbol string
[R5RS] Returns a symbol whose name is a string string. String may contain weird characters.

(string->symbol "a") => a
(string->symbol "A") => A
(string->symbol "weird symbol name" => |weird symbol name|

Function: gensym &optional prefix

This document was generated by Ken Dickey on November, 28 2002 using texi2html