To check for a symbol, one might use symbolp
. To check for a number, one might use numberp
. And so on…
Why is there no booleanp
to check for a boolean value? Of course I can use
(defun booleanp (x)
(or (null x)
(equal x t)))
but is there an easier (built-in) way of doing this? If not, is there a special reason, why just this predicate is missing?
(type-of t)
returnsboolean
I thought that it is an actual type. Isn't it? OTOHnil
is (of course) not of typeboolean
, since it's equivalent to the empty list. Hmmm… – Addiel