5.5. Macro `DEFCONSTANT`
Prev | Chapter 5. Data and Control Flow | Next

## 5.5. Macro `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.2, “Declaration `EXT:CONSTANT-NOTINLINE`”.

If you need to undo 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).

### 5.5.1. Variable `CUSTOM:*SUPPRESS-SIMILAR-CONSTANT-REDEFINITION-WARNING*`

If the variable 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.

| These notes document CLISP version 2.45 | Last modified: 2008-05-14

Enter your search termsSubmit search form
Webclisp.cons.orgclisp.podval.orgwww.lisp.org

Prev | Up | Next
5.4. Miscellaneous | Home | 5.6. Macro `EXT:FCASE`