In the post at Common Lisp class hierarchy, Rainer Joswig & Joshua Taylor carefully distinguish some of the differences between built-in Common Lisp types and classes, where classes form part of the CLOS extension to the baseline. The type/class (plus mop) distinctions are also reflected in Pfeil's comprehensive hierarchy diagram. Using the diagram, it seems possible to extract the two distinct hierarchies. In particular, I am currently most interested in the tops of the hierarchies; namely, the direct subtypes and subclasses of t
(since t
is both a type and a class). Here are some provisional subtypes/subclasses distilled from the diagram:
For the type hierarchy, the direct subtypes of t
seem to be atom
, character
, random-state
, hash-table
, restart
, readtable
, package
, pathname
, stream
, function
, array
, sequence
, number
, and condition
. All other types like float
or list
are subtypes of one of these types. The type hierarchy is also not strictly hierarchical (since (subtype t t) => T
, but this seems to be the only exception). (ps: the types symbol
and structure-object
are not included in the diagram, but also may be direct subtypes of t
.)
For the class hierarchy, the direct subclasses of t
include corresponding classes for all the types above (except atom
, and perhaps structure-object
which is now a subclass of standard-object
(?)), plus standard-object
.
The MOP extends CLOS by adding the class metaobject
(plus some meta-subclasses), but does not seem to add to the direct subclasses of t
.
Can someone verify if this understanding is correct, or provide additional clarifications?
Note: I've discovered at least one mistake in the type hierarchy description above. All of the listed subtypes (character
, etc.) are apparently subtypes of atom
, so they are not direct subtypes of t
. The only other direct subtype of t
seems to be sequence
, since a sequence can be a cons
(non-atom). Moreover, symbol
is, in fact, included in the diagram, and is also a subtype of atom
.