Right, but the question is "what should functionp return for an
autoload?"
1. t (naively)
2. nil (it _is_ a function, but the semantics are different from what
we normally mean by function)
3. autoload it and try again
Other ideas?
It should return nil for autoloaded macros. Here is how GNU Emacs
does it:
(defun functionp (object)
"Non-nil iff OBJECT is a type of object that can be called as 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)
(eq (car-safe object) 'lambda)))
--
John Paul Wallington