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 > (do
           (var x 1)
           (setq x 3)
           x)
it: 3
user > (do
           (let x 1)
           (setq x 3)
           x)
Cannot assign to a constant, future or lazy variable: x
user 1 > (var numbers '(1 2 3))
it: numbers
user 1 > (do
            (let-symbol-macro argh (car numbers))
            (setq argh 4))
it: 4
user 1 > numbers
it: (4 2 3)