3.2 Making declarations

3.2.1 SPECIAL declarations

Aspecial declaration specifies that a given variable will be dynamically scoped rather than lexically scoped. When a variable is dynamically bound, its value can be referred to and changed outside of the lexical scope of the binding as long as the point of reference is also within the dynamic scope of the binding.

To make a local declaration, which observes the rules of lexical scope, use thedeclare special form. To make a global declaration, which affects all bindings of the variable, use theproclaim function. To globally proclaim a special variable and give it an initial value, use the Common Lisp macrosdefvar anddefparameter.

The effect of aspecial declaration is exactly the same in both the Compiler and the interpreter. However, an unbound special variable can cause obscure errors in the compiled code.


The Advanced User's Guide - 9 SEP 1996

Generated with Harlequin WebMaker