2.4.2 Symbols
Booleans are also symbols; see Booleans for more operators.
x : t |
Returns t if and only if x is a symbol in the "KEYWORD" package.
Examples: |
> (keywordp :hints) |
t |
> (keywordp 'hints) |
() |
> (keywordp 5) |
() |
x : (symbolp x) |
y : (symbolp y) |
Returns non-nil when the symbol-name of x lexicographically precedes that of y. The returned number is the (0-based) position at which the names differ.
Examples: |
> (symbol-< 'aaa 'aab) |
t |
> (symbol-< 'ab 'ab) |
() |
> (symbol-< 'bb 'aa) |
() |
> (symbol-< "ab" 'ab) |
symbol->string: expects argument of type <symbol>; given |
"ab" |
x : (symbolp x) |
Returns a string containing the name of the given symbol
Examples: |
> (symbol-name 'hello) |
"HELLO" |
> (symbol-name 'qwerty) |
"QWERTY" |
> (symbol-name "uh-oh") |
symbol->string: expects argument of type <symbol>; given |
"uh-oh" |
x : (symbolp x) |
Returns the name of the package for the given symbol.
Examples: |
> (symbol-package-name 'hello) |
"COMMON-LISP" |
> (symbol-package-name "uh-oh") |
"COMMON-LISP" |
Determines whether x is a symbol.
Examples: |
> (symbolp 'hello) |
t |
> (symbolp "world") |
() |