Name

setq

Usage

special-form

Syntax

(setq sym value)

Description

Sets the value of a lexical, dynamic or global variable. If symbol macro expansion changes sym to something else, the compiler changes setq to setf before continuing the compilation.

user 1 > (do
             (var x 1)
             (setq x 3)
             x)
it: 3
user 2 > (do
             (let x 1)
             (setq x 3)
             x)
Cannot assign to a constant, future or lazy variable: x
user 3 1 > (var numbers '(1 2 3))
it: (1 2 3)
user 4 1 > (let-symbol-macro argh (car numbers))
it: null
user 5 1 > (setq argh 4)
it: 4
user 6 1 > numbers
it: (4 2 3)