The purpose of the Lisp reader is to accept characters, interpret them as the printed representation of a Lisp object, and construct and return such an object. However, the reader has many features that are not used by the output of the printer at all, such as comments, alternative representations, and convenient abbreviations for frequently used but unwieldy constructs. The reader is also parameterized in such a way that it can be used as a lexical analyzer for a more general user-written parser. The reader is organized as a recursive-descent parser. Broadly speaking, the reader operates by reading a character from the input stream and treating it in one of three ways.
Whitespace characters serve as separators but are otherwise ignored.
Constituent and escape characters are accumulated to make a token , which is then interpreted as a number or symbol. More precisely, when the reader is invoked, it reads a single character from the input stream and dispatches according to the syntactic type of that character. The characters of the standard character set initially have the syntactic types shown in table 22-1 . These characters are explicitly reserved to the user. The characters marked with an asterisk are initially constituents but are reserved to the user for use as macro characters or for any other desired purpose.