(rontolisp) docs
← Special Forms

setq

(setq name value ...)

Assigns value to the variable name, evaluating value but not name. Multiple name value pairs may be given; they are assigned left to right, so a later value can read an earlier assignment. The value of the last assignment is returned. setq operates in the variable namespace only (Lisp-2).

A name that no lexical binding holds and no defvar declares is the global variable of that name, wherever the setq stands -- inside a function body too -- on every backend, as in SBCL (which warns). Assigning an undeclared variable is undefined in Common Lisp; defvar or defparameter first is the portable spelling.

Such a global is unbound until its first assignment: a read of it before then -- by a function the program calls first, say -- signals an unbound-variable naming it, on every backend, as in SBCL.