3.5. The Evaluation and Compilation Dictionary [CLHS-3.8]

3.5.1. Function CONSTANTP
3.5.2. Macro EVAL-WHEN

3.5.1. Function CONSTANTP

Function CONSTANTP fully complies with [ANSI CL]. Additionally, some non-trivial forms are identified as constants, e.g., (CONSTANTP '(+ 1 2 3)) returns T.

Warning

Since DEFCONSTANT initial value forms are not evaluated at compile time, CONSTANTP will not report T of their name within the same compilation unit for the null lexical environment. This is consistent and matches questionable code using the pattern (if (CONSTANTP form) (EVAL form)). Use EVAL-WHEN if you need recognition and the value during compile-time.

3.5.2. Macro EVAL-WHEN

EVAL-WHEN also accepts the situations (NOT EVAL) and (NOT COMPILE).

Warning

The situations EVAL, LOAD and COMPILE are deprecated by the spec, and they are not equivalent to the new standard situations :EXECUTE, :LOAD-TOPLEVEL and :COMPILE-TOPLEVEL in that they ignore the top-level form versus non-top-level form distinction.


These notes document CLISP version 2.41Last modified: 2006-10-13