define-modify-macro doesn't do what CLHS 5.1.3 says
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Undecided
|
Douglas Katzman |
Bug Description
* (define-
* (macroexpand-1 '(snorkf (second (p)) (sqrt g) (compute-color)))
(LET* ((#:LIST538 (CDR (P)))
(#:NEW539 (SNORK (CAR #:LIST538) (SQRT G) (COMPUTE-COLOR))))
(SB-KERNEL:
The spec: "... these operators can be viewed as involving a form with the following general syntax:
(operator preceding-form* place following-form*)
The evaluation of each such form proceeds like this:
1. Evaluate each of the preceding-forms, in left-to-right order.
2. Evaluate the subforms of the place, in the order specified by the second value of the setf expansion for that place.
3. Evaluate each of the following-forms, in left-to-right order.
4. Read the old value from place.
5. Compute the new value.
6. Store the new value into place."
So 3, 4, 5 imply delaying (CAR #:LISTnnn) until after (SQRT) and (COMPUTE):
(LET* ((#:LIST562 (CDR (P)))
(#:G564 (SQRT G))
(#:G565 (COMPUTE-COLOR))
(#:NEW563 (SNORK (CAR #:LIST562) #:G564 #:G565)))
(%RPLACA #:LIST562 #:NEW563))
CLISP and ECL do that.
Changed in sbcl: | |
assignee: | nobody → Douglas Katzman (dougk) |
Changed in sbcl: | |
status: | New → Fix Committed |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |