Next: , Up: Character Syntax


2.1.1 Readtables

Syntax information for use by the Lisp reader is embodied in an object called a readtable. Among other things, the readtable contains the association between characters and syntax types.

The next figure lists some defined names that are applicable to readtables.

*readtable* readtable-case
copy-readtable readtablep
get-dispatch-macro-character set-dispatch-macro-character
get-macro-character set-macro-character
make-dispatch-macro-character set-syntax-from-char

Figure 2.1: Readtable defined names

2.1.1.1 The Current Readtable

Several readtables describing different syntaxes can exist, but at any given time only one, called the current readtable, affects the way in which expressions2 are parsed into objects by the Lisp reader. The current readtable in a given dynamic environment is the value of *readtable* in that environment. To make a different readtable become the current readtable, *readtable* can be assigned or bound.

2.1.1.2 The Standard Readtable

The standard readtable conforms to standard syntax. The consequences are undefined if an attempt is made to modify the standard readtable. To achieve the effect of altering or extending standard syntax, a copy of the standard readtable can be created; see the function copy-readtable.

The readtable case of the standard readtable is :upcase.

2.1.1.3 The Initial Readtable

The initial readtable is the readtable that is the current readtable at the time when the Lisp image starts. At that time, it conforms to standard syntax. The initial readtable is distinct from the standard readtable. It is permissible for a conforming program to modify the initial readtable.