Common Lisp/Reference/defvar

< Common Lisp < Reference

The defvar special form defines variables with a global scope. The following example declares a global variable with the symbol "temperature" and sets it's value to 20:

> (defvar temperature 20)

TEMPERATURE
> (print temperature)

20
20


See also

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.