Next: , Previous: , Up: Data Types   [Contents][Index]


2.1.4 Characters

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.

NameCodeLisp NameAlternatives
nul0#\NULL
bel0#\BELL
bs8#\BACKSPACE#\BS
tab9#\TAB
lf10#\NEWLINE#\NL #\LINEFEED #\LF
ff11#\VT#\PAGE #\FORM
cr13#\RETURN#\CR
esc27#\ESCAPE#\ESC #\ALTMODE #\ALT
sp32#\SPACE#\SP
del127#\DELETE#\RUBOUT

Table 2.1: Characters recognized by CMUCL

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]