@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}
\f
* 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
+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):
(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)))
\f
;;;; List functions.