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


    Date: 18 September 1980 1232-EDT (Thursday)
    From: Guy.Steele at CMU-10A
    To:   bug-lisp
    Re:   SETF of PROGN

    While we are fixing bugs in SETF why not add the setf-x properties for
    fixnum and flonum-identity?

    And while you are at it you might also want to do PROGN:

    (setf (progn x) 12) = (setf x 12)

    [More generally,
    	(setf (progn x1 x2 ... xn) 12) = (progn x1 x2 ... (setf xn 12))
    -- Guy]

My fix does handle (SETF (PROGN x1 x2 ... xn) v1), although it doesn't turn it
into (PROGN x1 x2 ... (SETF xn 12)).  There are severe modularity problems with
performing this transformation, but instead turns it into a LAMBDA with the x1
... xn-1 being passed in as arguments and ignored.  It is not only SETF that is
affected, but PUSH and POP and any user routines (like INCREMENT) which use
+INTERNAL-SETF-X-1 and friends to generate access and inversion with correct
order and no duplication of side-effects.  I have an idea for a way to do it,
but it requires a lot more work and recompilation of everything in the world
that does a DEFSETF.  Fortunately, I think I can make SETF complain if an old
DEFSETF is used.  Also, I don't think anyone has written anything like
INCREMENT that uses +INTERNAL-SETF-X-1, if so, they'll get a suprise.  I don't
know when I'll find the time to do this, however.