Next: Array Initialization, Previous: Extended Floats, Up: Data Types [Contents][Index]
CMUCL implements characters according to Common Lisp: The Language II. The
main difference from the first version is that character bits and font
have been eliminated, and the names of the types have been changed.
base-character
is the new equivalent of the old
string-char
. In this implementation, all characters are
base characters (there are no extended characters).
If (featurep :unicode)
is false, then character codes
range between 0
and 255
, using the ASCII encoding.
Otherwise, Unicode is supported and character codes corresond to utf-16
code units. See i18n for further information.
Table 2.1 shows characters recognized by CMUCL.
Name | Code | Lisp Name | Alternatives |
---|---|---|---|
nul | 0 | #\NULL | |
bel | 0 | #\BELL | |
bs | 8 | #\BACKSPACE | #\BS |
tab | 9 | #\TAB | |
lf | 10 | #\NEWLINE | #\NL #\LINEFEED #\LF |
ff | 11 | #\VT | #\PAGE #\FORM |
cr | 13 | #\RETURN | #\CR |
esc | 27 | #\ESCAPE | #\ESC #\ALTMODE #\ALT |
sp | 32 | #\SPACE | #\SP |
del | 127 | #\DELETE | #\RUBOUT |
When Unicode support is available, additional character names are
supported. If the Unicode character has a name, such as “GREEK SMALL
LETTER ALPHA”, you may use #\greek_small_letter_alpha
to
create the Greek character alpha whose code point value is
#x3b1
. Alternatively, you can specify a character using the
hex value of the code point. Hence #\u+3b1
produces the same
character. The u+
is required for hex values.
Next: Array Initialization, Previous: Extended Floats, Up: Data Types [Contents][Index]