type: function (subr) location: built-in source file: xlbfun.c Common LISP compatible: yes supported on: all machines
(set <symbol> <expr> ) <symbol> - expression that evaluates to a symbol name (if expression is quoted, no evaluation occurs) <expr> - an expression - which will be the new value
SET evaluates <symbol> and sets <expr> as it's value. If the <symbol> value is quoted (via the QUOTE special form or read-macro expansion), the <symbol> is not evaluated. SET returns the value from <expr> as it's result.
(set 'a 2) ; sets symbol A to value 2 (set 'value a) ; sets symbol VALUE to value 2 (print value) ; show the value - prints 2 (set 'name 'myvar) ; set symbol NAME to value MYVAR (set name 12345) ; set symbol which is the value ; of NAME (MYVAR) to 12345 (print name) ; prints MYVAR (print myvar) ; prints 12345 ; (set notsymbol 1) ; error: unbound variable (set name notvalue) ; error: unbound variable