User Tools

Site Tools


ch2_1_defparameter

DEFPARAMETER

Defines symbol in global scope as parameter. The forms DEFPARAMETER and DEFVAR are similar, and both have the purpose to make the LISP program more human-readable. There is no difference between the symbols defined by DEFVAR, DEFPARAMETER or just with SETQ.

The idea is that the value of symbol introduced with DEFPARAMETER will not used as changing variable, but as a parameter. If needed, it can be changed, preferably with another DEFPARAMETER.

DEFPARAMETER form needs two arguments, and can have one more optional description string. The first parameter must be a symbol. Symbols from base package (reserved), or symbols defined as constants will not be allowed. Second argument is evaluated, and will be bound as the value for the parameter. In case that the symbol is already bound, DEFPARAMETER will overwrite the value. Third, optional argument is a description string.

>(defparameter wheels 4 "usual number of wheels")   
WHEELS

See also: DEFVAR, SETQ, DEFCONSTANT

ch2_1_defparameter.txt · Last modified: 2022/02/23 07:13 by admin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki