Package: alexandria

Macro define-constant

Lambda List

define-constant (name initial-value &key test documentation)

Arguments

name -- a symbol which is not evaluated
initial-value -- a form which is evaluated
test -- a function designator
documentation -- a string which is not evaluated

Details

Ensures that the global variable named by name is a constant with a value that is equal under test to the result of evaluating initial-value.

test is a function designator that defaults to eql. If documentation is given, it becomes the documentation string of the constant. Signals an error if name is already a bound non-constant variable. Signals an error if name is already a constant variable whose value is not equal under test to the result of evaluating initial-value.