1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-22 18:35:09 +00:00

(functionp): Return nil for special forms.

This commit is contained in:
Stefan Monnier 2008-04-05 20:22:22 +00:00
parent 0e96e25f47
commit fc944cd4c5
4 changed files with 13 additions and 8 deletions

View File

@ -116,9 +116,7 @@ byte compiler. @xref{Byte-Code Type}.
@defun functionp object
This function returns @code{t} if @var{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.)
function, i.e. can be passed to @code{funcall}.
@end defun
Unlike @code{functionp}, the next three functions do @emph{not}

View File

@ -654,6 +654,9 @@ for the list of extra keys that are available.
* Incompatible Lisp Changes in Emacs 23.1
** `functionp' returns nil for special forms.
I.e. it only returns t for objects that can be passed `funcall'.
+++
** The multibyteness of process filters is determined by the coding-system
used for decoding. The functions `process-filter-multibyte-p' and

View File

@ -1,3 +1,7 @@
2008-04-05 Stefan Monnier <monnier@iro.umontreal.ca>
* subr.el (functionp): Return nil for special forms.
2008-04-05 Glenn Morris <rgm@gnu.org>
* emacs-lisp/autoload.el (autoload-ensure-default-file):

View File

@ -231,17 +231,17 @@ configuration."
(eq (car object) 'frame-configuration)))
(defun functionp (object)
"Non-nil if OBJECT is any kind of function or a special form.
Also non-nil if OBJECT is a symbol and its function definition is
\(recursively) a function or special form. This does not include
macros."
"Non-nil if OBJECT is a function."
(or (and (symbolp object) (fboundp object)
(condition-case nil
(setq object (indirect-function object))
(error nil))
(eq (car-safe object) 'autoload)
(not (car-safe (cdr-safe (cdr-safe (cdr-safe (cdr-safe object)))))))
(subrp object) (byte-code-function-p object)
(and (subrp object)
;; Filter out special forms.
(not (eq 'unevalled (cdr (subr-arity object)))))
(byte-code-function-p object)
(eq (car-safe object) 'lambda)))
;;;; List functions.