- (multiple-value-bind (expansion expanded)
- (sb!xc:macroexpand-1 form environment)
- (if expanded
- (sb!xc:get-setf-expansion expansion environment)
- (let ((new-var (gensym)))
- (values nil nil (list new-var)
- `(setq ,form ,new-var) form)))))
- ;; Local functions inhibit global SETF methods.
- ((and environment
- (let ((name (car form)))
- (dolist (x (sb!c::lexenv-funs environment))
- (when (and (eq (car x) name)
- (not (sb!c::defined-fun-p (cdr x))))
- (return t)))))
- (expand-or-get-setf-inverse form environment))
- ((setq temp (info :setf :inverse (car form)))
- (get-setf-method-inverse form `(,temp) nil))
- ((setq temp (info :setf :expander (car form)))
- ;; KLUDGE: It may seem as though this should go through
- ;; *MACROEXPAND-HOOK*, but the ANSI spec seems fairly explicit
- ;; that *MACROEXPAND-HOOK* is a hook for MACROEXPAND-1, not
- ;; for macroexpansion in general. -- WHN 19991128
- (funcall temp
- form
- ;; As near as I can tell from the ANSI spec,
- ;; macroexpanders have a right to expect an actual
- ;; lexical environment, not just a NIL which is to
- ;; be interpreted as a null lexical environment.
- ;; -- WHN 19991128
- (coerce-to-lexenv environment)))
- (t
- (expand-or-get-setf-inverse form environment)))))
+ (multiple-value-bind (expansion expanded)
+ (sb!xc:macroexpand-1 form environment)
+ (if expanded
+ (sb!xc:get-setf-expansion expansion environment)
+ (let ((new-var (gensym)))
+ (values nil nil (list new-var)
+ `(setq ,form ,new-var) form)))))
+ ;; Local functions inhibit global SETF methods.
+ ((and environment
+ (let ((name (car form)))
+ (dolist (x (sb!c::lexenv-funs environment))
+ (when (and (eq (car x) name)
+ (not (sb!c::defined-fun-p (cdr x))))
+ (return t)))))
+ (expand-or-get-setf-inverse form environment))
+ ((setq temp (info :setf :inverse (car form)))
+ (get-setf-method-inverse form `(,temp) nil))
+ ((setq temp (info :setf :expander (car form)))
+ ;; KLUDGE: It may seem as though this should go through
+ ;; *MACROEXPAND-HOOK*, but the ANSI spec seems fairly explicit
+ ;; that *MACROEXPAND-HOOK* is a hook for MACROEXPAND-1, not
+ ;; for macroexpansion in general. -- WHN 19991128
+ (funcall temp
+ form
+ ;; As near as I can tell from the ANSI spec,
+ ;; macroexpanders have a right to expect an actual
+ ;; lexical environment, not just a NIL which is to
+ ;; be interpreted as a null lexical environment.
+ ;; -- WHN 19991128
+ (coerce-to-lexenv environment)))
+ (t
+ (expand-or-get-setf-inverse form environment)))))