Control Structure Control Structure Generalized Variables
psetq form is just like
setq, except that multiple
assignments are done in parallel rather than sequentially.
setq. Given several symbol and form pairs, it evaluates all the forms in advance and then stores the corresponding variables afterwards.
(setq x 2 y 3) (setq x (+ x y) y (* x y)) x => 5 y ;
ywas computed after
xwas set. => 15 (setq x 2 y 3) (psetq x (+ x y) y (* x y)) x => 5 y ;
ywas computed before
xwas set. => 6
The simplest use of
(psetq x y y x), which
exchanges the values of two variables. (The
provides an even more convenient way to swap two variables;
see Modify Macros.)
psetq always returns