Common Lisp the Language, 2nd Edition
Next: Self-Evaluating Forms
Up: Program Structure
Previous: Program
Structure
The standard unit of interaction with a Common Lisp implementation is
the form, which is simply a data object meant to be
evaluated as a program to produce one or more values
(which are also data objects). One may request evaluation of
any data object, but only certain ones are meaningful. For
instance, symbols and lists are meaningful forms, while arrays normally
are not. Examples of meaningful forms are 3
, whose value is
3
, and (+ 3 4)
, whose value is 7
.
We write 3
=> 3
and (+ 3 4)
=> 7
to indicate these facts. (=> means ``evaluates
to.’’)
Meaningful forms may be divided into three categories: self-evaluating forms, such as numbers; symbols, which stand for variables; and lists. The lists in turn may be divided into three categories: special forms, macro calls, and function calls.
Any Common Lisp data object not explicitly defined here to be a valid
form is not a valid form. It is an error to evaluate anything but a
valid form.
Implementation note: An implementation is free to make implementation-dependent extensions to the evaluator but is strongly encouraged to signal an error on any attempt to evaluate anything but a valid form or an object for which a meaningful evaluation extension has been purposely defined.
X3J13 voted in October 1988 (EVAL-OTHER) to specify that all
standard Common Lisp data objects other than symbols and lists
(including defstruct
structures defined without the
:type
option) are self-evaluating.
Next: Self-Evaluating Forms
Up: Program Structure
Previous: Program
Structure
AI.Repository@cs.cmu.edu