A class for symbols.
[R7RS] Denotes a symbol that has weird name, including the characters that are not usually allowed in symbols. It can also include hex-escaped characters.
;; A symbol with spaces in its name '|this is a symbol| ⇒ |this is a symbol| ;; Unicode codepoint can be used following backslash-x escape, ;; and terminated by semicolon. '|\x3bb;| ⇒ λ
If the interpreter is running in case-insensitive mode, this syntax can be used to include uppercase characters in a symbol (see Case-sensitivity).
Denotes uninterned symbol. Uninterned symbols can be created
Uninterned symbols are mainly for legacy macros to avoid
variable conflicts. They are not registered in the internal
dictionary, so such symbols with the same name can’t be
(eq? '#:foo '#:foo) ⇒ #f (eq? '#:foo 'foo) ⇒ #f
When an S-expression including uninterned symbols are printed,
the srfi-38 syntax is used to indicate which uninterned symbol
is the same (
eq?) to which.
(let1 s '#:foo (list s s)) ⇒ prints (#0=#:foo #0#) (let ((s '#:foo) (t '#:foo)) (list s t s t)) ⇒ prints (#0=#:foo #1=#:foo #0# #1#)
[R7RS] 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
#t if symbol is an interned symbol,
#f if it is an uninterned symbol. An error is signaled
if symbol is not a symbol.
Every argument must be a symbol. Returns
every pair of arguments are
eq? to each other.
[R7RS] Returns the name of symbol in a string. Returned string is immutable.
(symbol->string 'foo) ⇒ foo
[R7RS] 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|
string->symbol, but the created symbol is uninterned.
(string->uninterned-symbol "a") ⇒ #:a
Returns a fresh, uninterned symbol. The returned symbol can never
eq? to other symbol within the process.
If prefix is given, which must be a string, it is used
as a prefix of the name of the generated symbol. It is mainly for
the convenience of debugging.
Both symbol and prefix must be symbols.
If the name of prefix matches the beginning part of the
name of symbol, this procedure returns a symbol whose
name is the name of symbol without the matched prefix.
Otherwise, it returns
(symbol-sans-prefix 'foo:bar 'foo:) ⇒ bar (symbol-sans-prefix 'foo:bar 'baz:) ⇒ #f
Returns a symbol with the name which is a concatenation of string representation of objs.
If the first argument is a boolean, it is recognized as the first form; the first argument specifies whether the resulting symbol is interned or not.
Each other argument is converted to a string as follows:
If it is a keyword, its name (with the preceding
:) is used.
For all other objects,
x->string is used. (The special treatment
of keyword is to keep the consistency before and after
keyword-symbol integration. See Keyword and symbol integration, for
This is upper-compatible to Bigloo’s same name procedure, which only allows symbols as the arguments and the result is always interned.
(string-append 'ab 'cd) ⇒ abcd (string-append 'ab ':c 30) ⇒ ab:c30 (string-append #f 'g 100) ⇒ #:g100