Generalized Variables

CLtL2 Reference 

macro CSETF : (place val)

CSETF is a more restricted version of setf in Common Lisp. First, since it is procedural, like CSETQ it does not return a value. Second, there is a much more restricted set of place-specifiers which are allowable. Here is a complete table of the allowable CSETF forms, and their equivalent SubL expansions:

CSETF form Equivalent SubL expansion

(CSETF variable value) (CSETQ variable value)
(CSETF (AREF vector n) value) (SET-AREF vector n value)
(CSETF (NTH n list) value) (SET-NTH n list value)
(CSETF (CAR cons) value) (RPLACA cons value)
(CSETF (CDR cons) value) (RPLACD cons value)
(CSETF (GET symbol indicator) value) (PUT symbol indicator value)
(CSETF (GETHASH key hashtable) value) (SETHASH key hashtable value)
(CSETF (SYMBOL-VALUE symbol) value) (SET symbol value)
(CSETF (defstruct-slot object) value) (set-defstruct-slot object value)


In the above table, defstruct-slot refers to any structure slot accessor function which got defined via defstruct, and set-defstruct-slot refers to the corresponding setter function for the given accessor.

Assignment Home Function Invocation