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

The values returned by SETF



    Date: Monday, 24 August 1987  14:47-EDT
    From: David A. Moon <Moon at STONY-BROOK.SCRC.Symbolics.COM>
    To:   D. Loewenstern <dml at NADC.ARPA>
    Re:   The values returned by SETF

        Date: Mon, 24 Aug 87 14:25:04 EDT
        From: dml@nadc.arpa (D. Loewenstern)

        Is the value returned by SETF defined in general, for all
        standard get/put functions?

        Specifically, what is returned by (SETF (VALUES IGNORE X)
        (VALUES 1 2))?

    SETF returns the values of its last subform (CLtL p.97).

Actually, it says "the ultimate result of evaluating the setf form is
the value of newvalue."  I would interpret your restatement to mean
that it has to return all the values of the newvalue form.  I can't
see how you can do this in a Common Lisp macro without using
Multiple-Value-List.  At least in our implementation:

  (setf foo (values 1 2 3))  =>  1

I would guess that the actual rule is that setf returns the number of
values that the setf method was expecting (supposing that the setf
method writer bothers to return the right value(s)).

  Rob