Greg Pfeil's Class Hierarchy diagram provides a comprehensive picture the Common Lisp type system. But I'm trying to better understand the class relationships at the top of the hierarchy. For a simple example, let (defstruct person name age)
, and then (defparameter *p1* (make-person :name "Yosh" :age 19)
. Now
(typep *p1* 'person)
T
(typep *p1* 'structure)
T
(typep *p1* 'structure-object)
T
(typep *p1* 'atom)
T
(typep *p1* t)
T
The Hyperspec says the precedence list for
structure-object
is only itself andt
. Areatom
andstructure
not types in the hierarchy?What are all the direct subtypes of
t
? More generally, how can you retrieve all the direct subtypes or supertypes of any given type (without trial-and-errorsubtypep
)? Alternately, is there a way to iterate over a list of all types? Does the MOP offer functions to get at all sub-/super-classes?By analogy with set theory, it would seem that all Common Lisp types/classes could theoretically be subdivided into two subclasses of
t
; namely,standard-object
(corresponding to elements with instances like the number 3, the string "abc", the structure s1, the method m1, etc.), andstandard-class
(corresponding to sets with instances like the classstandard-object
, the classnumber
, the classstructure-object
, etc.). If this is not the actual subdivision oft
, does the reason have something to do with practical implementation; for example, avoiding recursive class relationships in the hierarchy?