Common Lisp the Language, 2nd Edition


next up previous contents index
Next: Self-Evaluating Forms Up: Program Structure Previous: Program Structure

5.1. Forms

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.

old_change_begin
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.

old_change_end

change_begin
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.
change_end




next up previous contents index
Next: Self-Evaluating Forms Up: Program Structure Previous: Program Structure


AI.Repository@cs.cmu.edu