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

Re: (DEFMETHOD (setf foo) ... doesn't work



    Date: Wed, 10 Aug 88 15:12:36 EDT
    From: salem@Think.COM

    In the 8/2/88 version of PCL,

    (defmethod (setf foo) ....

    followed by a (setf (foo ... doesn't work because no DEFSETF has
    been done.

This is not supported in the 8/2 release of PCL.  It will be supported
in the next release.  A long message sent to the mailing list a couple
of days ago, which you may not have received, describes this change to
PCL.

    In any case, it was not clear to me from the CLOS spec. what the arglist
    should look like for SETF methods.  (Documentation bug ?)

The spec used to have a detailed description of this, and then it got
removed I guess because it was a duplication of a cleanup proposal.

At any rate, the correct form is:

(defmethod (setf foo) (new-value (object class)) ..)

Note that it is legal to specialize the new-value argument as well, if
for some reason you want to do that.  For example:

(defmethod (setf foo) ((new-value number) (object class)) ..)
(defmethod (setf foo) ((new-value symbol) (object class)) ..)


    P.S.  Is this the appropriate list for both these questions ?

This list is appropriate for both of these questions.
-------