DEFCONSTANT
The initial value is not evaluated at compile time,
just like with DEFVAR
and DEFPARAMETER
.
Use EVAL-WHEN
if you need the value at compile time.
constant variables may not be bound dynamically or lexically.
See also Section 3.3.3, “Declaration EXT:CONSTANT-NOTINLINE
”.
If you need to undo the effects of a DEFCONSTANT
form,
PROCLAIM
the symbol SPECIAL
(to turn the constant variable into a dynamic variable),
and then PROCLAIM
it EXT:NOTSPECIAL
(to turn the dynamic variable into a lexical variable).
If you follow the usual variable naming convention
(*FOO*
for DEFVAR
and DEFPARAMETER
,
+BAR+
for DEFCONSTANT
, ZOT
for LET
/LET*
), you will save yourself a lot of trouble.
See also Q: A.4.14.
CUSTOM:*SUPPRESS-SIMILAR-CONSTANT-REDEFINITION-WARNING*
If the variable being defined by DEFCONSTANT
is already bound to
a value which is not EQL
to the new value, a WARNING
is issued.
If, however, the new value is visually similar
(prints to the same string, as is commonly the case when re-loading files)
to the old one, the warning can be suppressed by setting
CUSTOM:*SUPPRESS-SIMILAR-CONSTANT-REDEFINITION-WARNING*
to a non-NIL
value.
The initial value of CUSTOM:*SUPPRESS-SIMILAR-CONSTANT-REDEFINITION-WARNING*
is NIL
.
These notes document CLISP version 2.49.93+ | Last modified: 2018-02-19 |