[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Issue: SETF-METHOD-FOR-SYMBOLS (version 1)

I tried Daly's example in Spice Lisp, and it gave what Moon proposes as
the intuitive answer: both R and S end up with (A 1 B 6 C 3).  And in
the same Lisp, (get-setf-method 'foo) returns the values prescribed in
CLtL: nil nil (#:G1) (setq foo #:G1) foo.  So the statement in Moon's
proposal that Daly's example is impossible to implement with with this
set of values is false.  There might be other examples which dictate the
change in get-setf-method that Moon proposes, but this particular
case does not force the issue.

The trick here is that the get-setf-method value-set for Getf sets up
all of the necessary bindings, rather than doing this in the method for
a symbol:

(get-setf-method '(getf a b)) =>

(#:G1 #:G2)
(A B)
(progn (setq #:G1 (%putf #:G1 #:G2 #:G3))
       (setq A #:G1)
(getf #:G1 #:G2)

Is there some problem here I don't see?

For what it's worth, I get the following:

(setf (getf (nthcdr 2 r) 'b) (progn (setq r nil) 6))
r = nil, s = (a 1 b 6 c 3)

(setf (nthcdr 2 r) (progn (setq r nil) 6))
r= nil, s = (a 1 . 6)

I think that these values are right, since changing the tail of the old
value of R can't set anything back into R to override the explict SETQ.
Anyone disagree?  Our code gets no failures trying to setq the nthcdr of
nil, or whatever.

Unless I'm missing something, I would say that these examples shoot down
Moon's proposal in its current form.

-- Scott