From: "Drew Adams" <drew.adams@oracle.com>
To: "Bug-Gnu-Emacs" <bug-gnu-emacs@gnu.org>
Subject: functionp should be, in effect, funcallablep
Date: Mon, 27 Aug 2007 08:57:30 -0700 [thread overview]
Message-ID: <DHEEKFAFJEFOJHLCFPFDCEJACAAA.drew.adams@oracle.com> (raw)
`functionp' returns non-nil for special forms, as well as functions
that you can pass to `funcall' and `apply'. Prior to Emacs 22, it
apparently returned non-nil also for macros.
There is no simple predicate to test whether an object is a function
that is appropriate as the first argument for `funcall' and `apply'.
You can pass a function definition (e.g. `symbol-function' of a
symbol with non-empty function cell) to `subr-arity', and check for
`unevalled', but there is no predefined test that does the job.
Suggestion: Either (1) fix `functionp' so that it returns non-nil only
for functions that can be used by `funcall' and `apply', or (2) create
a new function (e.g. `funcallablep') that does this.
With (1), you could then do (if (functionp foo) (funcall foo)...).
With (2), you could do (if (funcallablep foo) (funcall foo)...).
In GNU Emacs 22.1.1 (i386-mingw-nt5.1.2600)
of 2007-06-02 on RELEASE
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --cflags -Ic:/gnuwin32/include'
reply other threads:[~2007-08-27 15:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DHEEKFAFJEFOJHLCFPFDCEJACAAA.drew.adams@oracle.com \
--to=drew.adams@oracle.com \
--cc=bug-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).