--- Begin Message ---
Subject: |
Re: [Gcl-devel] Re: setf |
Date: |
Fri, 03 Oct 2003 23:09:17 -0500 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 |
Camm Maguire wrote:
I don't believe defsetf causes a (setf ...) function to be defined
at all. Instead, it causes a setf *expander* to be defined. Macros
like SETF would call GET-SETF-EXPANSION to get this expansion.
So (setf foo x) never uses the (setf foo) function definition if any
What's the point of this function name if not anyway? What are the
forms that use this function? I already see that ((setf foo) ...) is
illegal. (function (setf foo) ) should work, and therefore (fboundp
#'(setf foo)), etc. (defun (setf foo) ...) is the only way to define
this function, right? Anything else I need to know?
If you define a function (setf foo), and there is no setf expander for
foo, then the expression (setf (foo x1 ... xk) y) is equivalent to
(funcall #'(setf foo) x1 ... xk y).
However, defsetf doesn't define a function called (setf foo), but rather
provides a setf expander. If you want to define a function (setf foo)
you need to use defun, defgeneric, flet, or labels.
Paul
--- End Message ---