The special forms
allow you to define the global variables that will be used by a
Defines a lexically scoped global variable called variable. It will have the result of evaluating form assigned to it.
Note that the
define special form may also be used to declare
block-structured functions, Definitions.
This special form defines a special (i.e. dynamically scoped) variable, the symbol variable. If the value of variable is void the form is evaluated and its value is stored as the value of variable (note that only the default value is modified, never a buffer-local value). If no form is given the assigned value defaults to false.
If the doc-string argument is defined it is a string documenting variable (see Docstrings).
(defvar *my-variable* '(x y)
"This variable is an example showing the usage of the
define suffices. For the reason,
see See Modules and Special Variables.
setq, so defines var as a special
variable, and sets the value to value.
defvar-setq above. A very confusing name, so it’s
defconst defines a global constant, the symbol constant.
Its value is set to the result of evaluating form. Note that
defvar the value of the symbol is always set, even
if it already has a value.
The doc-string argument, if defined, is the documentation string for the constant.
(defconst the-answer 42 "An example constant.") ⇒ the-answer