Function: cl-functionp

cl-functionp is a byte-compiled function defined in cl-preloaded.el.gz.

Signature

(cl-functionp OBJECT)

Documentation

Return non-nil if OBJECT is a member of type function.

This is like functionp except that it returns nil for all lists and symbols, regardless if funcall would accept to call them.

View in manual

Probably introduced at or before Emacs version 30.1.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/cl-preloaded.el.gz
;; FIXME: Our type DAG has various quirks:
;; - Some `keyword's are also `symbol-with-pos' but that's not reflected
;;   in the DAG.
;; - An OClosure can be an interpreted function or a `byte-code-function',
;;   so the DAG of OClosure types is "orthogonal" to the distinction
;;   between interpreted and compiled functions.

(defun cl-functionp (object)
  "Return non-nil if OBJECT is a member of type `function'.
This is like `functionp' except that it returns nil for all lists and symbols,
regardless if `funcall' would accept to call them."
  (memq (cl-type-of object)
        '(primitive-function native-comp-function module-function
          interpreted-function byte-code-function)))