pairs | pairs of places and values |
SETF is similar to SETQ but works with generalized places. Many functions for read access can be turned into write access. See LET, SETQ. SETF expanders can be defined in multiple ways, most easier is (defun (setf my-name) arguments body...).
(let (a b) (setf a 4) (setf b 3) (setf a (+ a b))) => 7 (let ((a #(1 2 3 4))) (setf (aref a 2) 'new-value) a) => #(1 2 NEW-VALUE 4) (let ((a '(1 2 3 4))) (setf (third a) 'new-value) a) => (1 2 NEW-VALUE 4)