mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-14 05:12:38 -08:00
SETF places which are macr calls have to be expanded using MACROEXPAND-1 (ANSI 5.1.2.7)
This commit is contained in:
parent
f40e78e063
commit
08e31d4a55
2 changed files with 6 additions and 2 deletions
|
|
@ -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 ***
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue