Kaz Kylheku
4/1/2015 6:38:00 PM
On 2015-04-01, Pascal J. Bourguignon <pjb@informatimago.com> wrote:
> Kaz Kylheku <kaz@kylheku.com> writes:
>
>> NIL's type (class, actually) is called NULL. This NULL class is considered the
>> subclass of every other class. It has only one instance: NIL.
>
> Nope. You are confusing types and classes.
No, I'm not; I confused NULL and NIL, though! And played it a too loose
with the "subclass" terminology.
NULL is not the subtype of every other type. (Pardon me while I wipe
some remaining egg off my face.) If that were true, then every type would have
NIL in its domain as a member. The object NIL would be a number, a string, a
vector, ...
It is NIL which has the property of being everthing's subtype, which is
possible since its membership is empty.
NULL does some parentage, which is obvious:
(subtypep 'null 'list) -> t
(subtypep 'null 'symbol) -> t
(subtypep 'null 't) -> t
since NIL is a list and a symbol, and everything is a T.
> There's no class named NIL.
> (it would have little purpose, since there's no object of type NIL!)
That little purpose could be:
(defmethod foo ((x nil) ...)
;; method not applicable to anything: impossible to dispatch!
...)
Similar in effect to:
#-(and) (defmethod foo ....)
:)