help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: funcallable-p?


From: Drew Adams
Subject: RE: funcallable-p?
Date: Sat, 25 Aug 2007 23:01:32 -0700

> > What's a good way to test the first argument to `funcall' or `apply', to
> > ensure that it is appropriate?
>
> `functionp'
>
> > `functionp' won't do it, because it allows special forms and macros.
>
> If it does it's a bug: please report it with a precise test case.

That's the impression I got from 1) the doc and 2) (functionp 'and) -> t,
(funcall 'and t) -> Invalid function: and.

Elisp manual: "This function returns `t' if OBJECT is any kind of function,
or a special form, or, recursively, a symbol whose function definition is a
function or special form.  (This does not include macros.)"

I mispoke about macros. I really meant special forms. `functionp' doesn't
distinguish between functions and special forms, right? If so, is there an
idiom or convention for such a test, of shall I just test `functionp' and
not a member of the list of special forms?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]