setf
(setf place value [place2 value2 ...])
Generalized assignment: stores value into the location named by place and returns the value. Beyond plain variables, the supported places are the list accessors car, cdr, nth, first through fourth, rest, and the caXXXr compositions, plus elt (a runtime list/string/vector dispatch: a list cell and a vector -- including a mutable buffer from make-string -- are written in place, while a string literal is rebuilt and rebound like (setf (char ...)), so its place must be a variable and an alias made before the write still sees the old content), so you can mutate a specific slot of an existing structure in place. It expands into the appropriate primitive mutator (such as rplaca/rplacd). Place subforms are evaluated before the value, so the tail-collection idiom (setf (cdr tail) (setf tail (list x))) links the old tail.
Multiple place/value pairs assign sequentially (each pair sees the effects of the previous ones), and the last value is returned:
(setf (getf place indicator) value) writes a property list: when the indicator already has a cell its VALUE cell is written in place (so an alias of the same list sees the update), otherwise the pair is consed onto the front and the result stored back through place. A third subform in the place is getf's default and is ignored by the write.
Beyond the built-in places, a defstruct accessor, a CLOS :accessor, and a user-defined setf-function ((defun (setf name) ...), or the generic (defmethod (setf name) ...) — see defmethod) are also places: (setf (name arg...) value) calls the writer with the new value first, though the place's arguments are evaluated before the value, left to right. See defun for setf-function definitions. A place whose operator nothing makes a place is the same call of the (setf name) function, looked up when the form runs, as in Common Lisp: the function may be defined later in the file or installed with (setf (fdefinition '(setf name)) fn), and when there is none the form signals undefined-function naming (setf name) (the compilers warn at compile time). A standard Common Lisp name that is not a supported place, such as (setf (length x) 3), is refused when the form is expanded (setf does not support place: LENGTH). (setf (symbol-function 'name) fn) / (setf (fdefinition 'name) fn) install a global function definition (see symbol-function).