[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: FUNCTIONP



I agree FUNCTIONP isn't terribly useful - but p. 76 is pretty precise.
I think the key is that the object "is suitable" for being
a function (ignoring issues of whether you can redefine special-forms
etc.)

To find out if something is really a (global) function would this 
be good enough?

(DEFUN REALLY-A-FUNCTION-P (OBJECT)
  (AND (FUNCTIONP OBJECT)
       (FBOUNDP OBJECT)
       (NOT (MACRO-FUNCTION OBJECT))
       (NOT (SPECIAL-FORM-P OBJECT))))

Definitely verbose and I too would prefer a builtin...

A real interpreted function would be:

(DEFUN INTERPRETED-FUNCTION-P (OBJECT)
  (AND (REALLY-A-FUNCTION-P OBJECT)
       (NOT (COMPILED-FUNCTION-P #'OBJECT))))


--ilan