[armedbear-devel] defun return value is not conforming.

Pascal J. Bourguignon pjb at informatimago.com
Sat Nov 20 06:26:24 UTC 2010


CLHS says:

    Macro DEFUN

    Syntax:

    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)))) 
(correct)

After:   (PROGN (SYSTEM:%DEFUN (QUOTE F) (SYSTEM:NAMED-LAMBDA F (X) (BLOCK F (1+ X)))))
WRONG.


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.





More information about the armedbear-devel mailing list