Common Lisp the Language, 2nd Edition

next up previous contents index
Next: Declaration Syntax Up: Common Lisp the Language Previous: Environments

9. Declarations

Declarations allow you to specify extra information about your program to the Lisp system. With one exception, declarations are completely optional and correct declarations do not affect the meaning of a correct program. The exception is that special declarations do affect the interpretation of variable bindings and references and so must be specified where appropriate. All other declarations are of an advisory nature, and may be used by the Lisp system to aid the programmer by performing extra error checking or producing more efficient compiled code. Declarations are also a good way to add documentation to a program.

Note that it is considered an error for a program to violate a declaration (such as a type declaration), but an implementation is not required to detect such errors (though such detection, where feasible, is to be encouraged).