changeset 17418:726a87ac1486

(functionp): New function.
author Richard M. Stallman <rms@gnu.org>
date Sat, 12 Apr 1997 19:13:07 +0000
parents c351a7e1880c
children c9f73399244c
files lisp/subr.el
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/subr.el	Sat Apr 12 18:49:35 1997 +0000
+++ b/lisp/subr.el	Sat Apr 12 19:13:07 1997 +0000
@@ -973,6 +973,12 @@
   (and (consp object)
        (eq (car object) 'frame-configuration)))
 
+(defun functionp (object)
+  "Non-nil of OBJECT is a type of object that can be called as a function."
+  (or (subrp object) (compiled-function-p object)
+      (eq (car-safe object) 'lambda)
+      (and (symbolp object) (fboundp object))))
+
 ;; now in fns.c
 ;(defun nth (n list)
 ;  "Returns the Nth element of LIST.