SETF places which are macr calls have to be expanded using MACROEXPAND-1 (ANSI 5.1.2.7)

This commit is contained in:
jjgarcia 2008-09-04 21:03:24 +00:00
parent f40e78e063
commit 08e31d4a55
2 changed files with 6 additions and 2 deletions

View file

@ -82,6 +82,8 @@ ECL 0.9l-p1:
- Inline/not-inline declarations for SETF-functions are not ignored (Josh
Elsasser).
- When a SETF place is a macro, it has to be expanded with MACROEXPAND-1.
;;; Local Variables: ***
;;; mode:text ***
;;; fill-column:79 ***

View file

@ -110,8 +110,10 @@ Does not check if the third gang is a single-element list."
(push item names))
(push item all-args))
(values (gensym) (nreverse names) (nreverse values) (nreverse all-args))))
;; Note that macroexpansion of SETF arguments can only be done via
;; MACROEXPAND-1 [ANSI 5.1.2.7]
(cond ((symbolp form)
(if (and (setq f (macroexpand form env)) (not (equal f form)))
(if (and (setq f (macroexpand-1 form env)) (not (equal f form)))
(get-setf-expansion f env)
(let ((store (gensym)))
(values nil nil (list store) `(setq ,form ,store) form))))
@ -130,7 +132,7 @@ Does not check if the third gang is a single-element list."
(setf-structure-access (car all) (car f) (cdr f) store))
((setq f (get-sysprop (car form) 'SETF-LAMBDA))
(apply f store all))
((and (setq f (macroexpand form env)) (not (equal f form)))
((and (setq f (macroexpand-1 f env)) (not (equal f form)))
(return-from get-setf-expansion
(get-setf-expansion f env)))
(t