This document is a comprehensive Reference Manual for Common LISP: The Language, authored by Guy L. Steele Jr. with contributions from Scott E. Fahlman, Richard P. Gabriel, David A. Moon, and Daniel L. Weinreb.
The manual outlines the purpose and goals of Common LISP, which include:
- Commonality: Unifying various LISP implementations (like MacLISP, Zetalisp, Scheme, Interlisp, NIL, S-1 LISP) into a standard dialect.
- Portability: Excluding features difficult to implement across diverse hardware while maintaining efficiency.
- Consistency: Ensuring identical semantics between the interpreter and compiler for correct programs.
- Expressiveness: Incorporating useful constructs from various LISP dialects and programming languages.
- Compatibility: Striving to be compatible with Zetalisp, MacLISP, and Interlisp, in that order.
- Efficiency & Power: Providing features for high-quality compiled code and system-building tools.
- Stability: Aiming for slow, deliberate changes with extensions tested in supersets.
The book defines Common LISP as a language specification, rather than an implementation detail or a programming environment guide.
Key areas covered in the manual include:
- Introduction & Notational Conventions: Explains the purpose of Common LISP, the symbols used for evaluation, macro expansion, and equivalence, and defines terms like "error" and "signalled error." It also details the syntax overview for reading LISP objects and code.
- Data Types: Describes a rich hierarchy of data types, including numbers (integers, ratios, floating-point, complex), characters, symbols, lists (conses), arrays (vectors, strings, bit-vectors), hash tables, readtables, packages, pathnames, streams, random-states, user-defined structures, and functions. It elaborates on their properties, representations, and relationships.
- Scope and Extent: Defines the spatial (lexical) and temporal (dynamic) regions within which entities (like variables, catchers, go targets) can be referenced, and explains shadowing rules.
- Type Specifiers: Details how LISP objects (symbols and lists) are used to name and specify data types, including mechanisms for combining and specializing types, and defining new type specifiers (
deftype).
- Program Structure: Explains LISP programs as "forms" that are evaluated, categorizing them into self-evaluating forms, variables, special forms, macro calls, and function calls. It also covers top-level forms for defining functions, variables, and constants.
- Predicates: Describes functions for testing conditions, particularly those for data types (
typep, subtypep) and equality (eq, eql, equal, equalp).
- Control Structure: Covers various constructs for managing program flow, such as conditionals (
if, cond, case), iteration (loop, do, dolist, dotimes), and non-local exits (block, catch, throw), including mechanisms for handling multiple values.
- Macros: Explains the macro facility for transforming LISP forms before evaluation or compilation, including macro definition (
defmacro) and expansion.
- Declarations: Details how to provide optional advisory information to the LISP system, especially the compiler, for optimization and error checking (
declare, proclaim).
- Symbols, Packages, and Modules: Describes symbols as data objects with property lists and print names, the package system for organizing symbols into name spaces to prevent conflicts, and modules for loading LISP subsystems.
- Numbers, Characters, Sequences, Lists, Arrays, Strings, Hash Tables (Detailed): Provides in-depth discussions and functions for operations specific to these core data types, including arithmetic, logical operations, type conversions, string manipulation, sequence searching, sorting, and list structure alteration.
- The Evaluator, Streams, and File System Interface: Explains the core evaluation mechanism (
eval), stream operations for I/O, formatted output (format), and the pathname system for portable file system interaction.
- Errors: Describes functions for signaling different types of errors (fatal vs. continuable) and tools for error checking (
check-type, assert).
- Miscellaneous Features: Covers the compiler interface, documentation facilities, debugging tools (tracing, stepping, inspecting), and environment inquiries (time functions, system information).
Throughout the manual, it provides examples, "Compatibility notes" contrasting Common LISP with other dialects, and "Implementation notes" offering advice for system developers.