All Manuals > LispWorks User Guide and Reference Manual > 9 The Compiler

NextPrevUpTopContentsIndex

9.6 Declare, proclaim, and declaim

The special form declare is used to:

declare behaves computationally as if it is not present (other than to affect the semantics), and is only allowed in certain contexts, such as after the variable list in a let , do , defun and so on. Consult the syntax definition of each special form to see if it accepts declare forms.

For the details, including some LispWorks extensions to Common Lisp, see the reference entry for declare.

The function proclaim parses declarations in a specified list and then puts their semantics and advice into global effect. This can be useful when compiling a file for speedy execution, since a proclamation such as:

(proclaim '(optimize (speed 3) (space 0) (debug 0)))

causes the rest of the file to be compiled with these optimization levels in effect. (A lengthier way to do this is to make appropriate declarations in every function in the file.) Below are some more examples:

(proclaim '(special *fred*))
(proclaim '(type single-float x y z))
(proclaim '(optimize (safety 0) (speed 3)))

Do not forget to quote the argument list if it is a constant list. This form:

(proclaim (special x))

attempts to call function special .

declaim is a macro equivalent to proclaim.

9.6.1 Naming conventions


LispWorks User Guide and Reference Manual - 21 Dec 2011

NextPrevUpTopContentsIndex