unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* functionp should be, in effect, funcallablep
@ 2007-08-27 15:57 Drew Adams
  0 siblings, 0 replies; only message in thread
From: Drew Adams @ 2007-08-27 15:57 UTC (permalink / raw)
  To: Bug-Gnu-Emacs

`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'

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-08-27 15:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-27 15:57 functionp should be, in effect, funcallablep Drew Adams

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).