[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
fixing our problems with setf
Date: Mon, 12 Oct 87 16:52 EDT
From: David A. Moon <Moon@STONY-BROOK.SCRC.Symbolics.COM>
After thinking it over, I think Gregor's proposal to simplify the
way setf-functions work is reasonable. There will be some adoption
cost for us, because the order of arguments to a setf function is
being changed from what we agreed on before, but I think we can
come up with a compatibility kludge to take care of that. Of course,
Gregor's proposal doesn't really eliminate the scoping issues, not
only because we cannot get rid of defsetf and define-setf-method,
but also because of the already defined interaction of setf with
macros. However, I think the scoping rules are quite
Right, what it does do is make the scoping rules simpler and allows a
style in which there is no desire to lexically bind setf macros.
Here is a revised version of what I mailed out on September 28,
modified and simplified to reflect what Gregor proposed:
I just have a couple of comments on your writeup.
As with regular functions, associated with any given name you can have a
setf function or a setf macro, but not both. This means that one does
not define a setf function (with defmethod or defgeneric) and also call
defsetf. The mere act of defining the setf function is enough to tell
setf what to do. In fact setf only needs for the setf function to be
defined at run time, not at compile time.
* one could very well have defsetf of FOO and a function named (setf
foo). This might be weird, but nothing prevents it from happening.
* the meaning of the last sentence would be more clear if the next to
the last sentence was removed and the last sentence changed to:
"In the absence of any setf macro definition, SETF expands into a call
to the setf function. This means that the setf function only needs to
be defined at run time, not compile time."
I would like to see what you send to cleanup beforehand if possible.
But I do not expect to read my mail the last half of this week or the
first half of next, so that might make it impossible.