[armedbear-devel] defun return value is not conforming.
alessiostalla at gmail.com
Sat Nov 20 09:32:11 UTC 2010
On Sat, Nov 20, 2010 at 7:26 AM, Pascal J. Bourguignon
<pjb at informatimago.com> wrote:
> CLHS says:
> Macro DEFUN
> defun function-name lambda-list [[declaration* | documentation]] form*
> => function-name
> Arguments and Values:
> function-name---a function name.
> and the glossary:
> function name n. 1. (in an environment) A symbol or a list (setf
> symbol) that is the name of a function in that environment. 2. A
> symbol or a list (setf symbol).
> Therefore (defun f () ...) should return the symbol F, not the function F.
> Unfortunately, after having loaded quicklisp, it looks like abcl switches
> to another definition, which returns a function instead of a name:
> (macroexpand '(defun (x) (1+ x)))
> Before: (SYSTEM:%DEFUN (QUOTE F) (LAMBDA (X) (BLOCK F (1+ X))))
> After: (PROGN (SYSTEM:%DEFUN (QUOTE F) (SYSTEM:NAMED-LAMBDA F (X) (BLOCK F (1+ X)))))
I don't know what's causing the definition of DEFUN to change; but
anyway both of your code snippets correctly return the symbol F. Are
you sure that's the exact macroexpansion you get? (btw, the
macroexpand form should be (macroexpand '(defun F (x) (1+ x))) -- f
I'll try later to load quicklisp and reproduce the problem.
More information about the armedbear-devel