[armedbear-devel] "Hardcoding" methods that funcall a symbol

Pascal J. Bourguignon pjb at informatimago.com
Sun Dec 15 14:35:32 UTC 2013


Theam Yong Chew <senatorzergling at gmail.com> writes:

> I also updated java:jnew-runtime-class's docstring, but I'm not sure
> if the wording "function designator" is accurate enough, since
> (funcall '(lambda () 1)) => 1
>
> Would '(lambda () 1) be considered a FUNCTION DESIGNATOR? 

CLHS Glossary says:

    function designator n. a designator for a function; that is, an
    object that denotes a function and that is one of: a symbol
    (denoting the function named by that symbol in the global
    environment), or a function (denoting itself). The consequences are
    undefined if a symbol is used as a function designator but it does
    not have a global definition as a function, or it has a global
    definition as a macro or a special form. See also extended function
    designator.

therefore:

    (defun function-designator-p (object)
       (or (symbolp object)
           (functionp object)))

    (function-designator-p '(lambda () 1))
    --> NIL

So, the answer is no.



-- 
__Pascal Bourguignon__
http://www.informatimago.com/



More information about the armedbear-devel mailing list