Next: Vectors Up: Basic Data Extensions Previous: Strings

# Symbols

MzScheme provides two ways of generating an uninterned symbol, i.e., a symbol that is not `eq?`, `eqv?`, or `equal?` to any other symbol:

- `(string->uninterned-symbol string)` is like `(`string->symbol` string)`, but the resulting symbol is a new uninterned symbol. Calling `string->uninterned-symbol` twice for the same s returns two distinct symbols.
- `(gensym [symbol/string])` creates an uninterned symbol with an automatically-generated name. The optional symbol/string argument is a prefix symbol or string.

Regular (interned) symbols are only weakly held by the internal symbol table. This weakness can never affect the result of a `eq?`, `eqv?`, or `equal?` test, but a symbol placed into a weak box (see section 12.1) or used as the key in a weak hash table (see section 4.12) may disappear.