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

bug in setf documentation

    Date: 24 Mar 1984 14:36:31-EST
    From: <smh@mit-ems@mit-mc>

    The Franz manual carefully defines
	    (setf g_refexpr 'g_value)
    to return g_value.  Unfortunately, this is not true.  If g_refexpr
    ultimately refers to the car or cdr of a list cell, the value returned
    will be the modified cell, not its car or cdr.  Similarly, if g_refexpr
    is a cxr of a hunk, the entire hunk is returned.
    . . .
    The proper fix is to change the manual.  If one were so bold as to
    plagarize a sentence from the (MIT) Lisp Machine Manual:

	    "[T]he value produced by setf depends on the structure type and
	     is not guaranteed;  setf should be used for side effect only."

    Steve Haflich
    MIT Experimental Music Studio
    decvax!genrad!mit-ems!smh, smh@mit-ems@mit-mc

To document such bugs is not the proper fix. The right thing is to fix
the bugs:  Introduce the modifier functions set-car, set-cdr, etc,
supporting them (including, especially, compiler support) at the level
that rplaca currently is; cause (setf (car x) y) to expand into (set-car
x y) which returns y; and demote rplaca etc to become mere compatibility