The long form defsetf resembles defmacro . The store-variables describe the value or values to be stored into the place . The body must compute the expansion of a setf of a call on access-fn . The expansion function is defined in the same lexical environment in which the defsetf form appears. The body code in defsetf is implicitly enclosed in a block whose name is access-fn defsetf ensures that subforms of the place are evaluated exactly once.
Documentation is attached to access-fn as a documentation string of kind setf .
If a defsetf form appears as a top level form , the compiler must make the setf expander available so that it may be used to expand calls to setf later on in the file . Users must ensure that the forms , if any, can be evaluated at compile time if the access-fn is used in a place later in the same file . This is handled by forms rather than by defsetf because in many cases this value can be returned at no extra cost, by calling a function that simultaneously stores into the place and returns the correct value.