[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gcl-devel] Re: setf
From: |
Camm Maguire |
Subject: |
Re: [Gcl-devel] Re: setf |
Date: |
03 Oct 2003 22:44:46 -0400 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
Hi Paul! Thanks as always!
"Paul F. Dietz" <address@hidden> writes:
> 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?
Take care,
> Example from SBCL:
>
> * (defun foo (x) (car x))
>
> FOO
> * (defsetf foo rplaca)
>
> FOO
> * #'(setf foo)
>
> debugger invoked on condition of type UNDEFINED-FUNCTION:
> The function (SETF FOO) is undefined.
>
> Within the debugger, you can type HELP for help. At any command prompt (within
> the debugger or not) you can type (SB-EXT:QUIT) to terminate the SBCL
> executable. The condition which caused the debugger to be entered is bound to
> *DEBUG-CONDITION*. You can suppress this message by clearing
> *DEBUG-BEGINNER-HELP-P*.
>
> restarts (invokable by number or by possibly-abbreviated name):
> 0: [ABORT ] Reduce debugger level (leaving debugger, returning to
> toplevel).
> 1: [TOPLEVEL] Restart at toplevel READ/EVAL/PRINT loop.
> (FDEFINITION 1 (SETF FOO))[:EXTERNAL]
> 0] 0
>
> * (macroexpand '(setf (foo x) y))
>
> (RPLACA X Y)
> T
> *
>
> Paul
>
>
>
>
> _______________________________________________
> Gcl-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/gcl-devel
>
>
>
--
Camm Maguire address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah