11

How do I see if one CLOS class is a subclass of another CLOS class?

bmargulies
  • 97,814
  • 39
  • 186
  • 310
krzysz00
  • 2,083
  • 12
  • 24

2 Answers2

11

You can get the CLASS-NAME of a class.

A class has also a type of the same name.

SUBTYPEP tests if a type is a subtype of another type.

Rainer Joswig
  • 136,269
  • 10
  • 221
  • 346
3

closer-mop provides a subclassp predicate

CL-USER> (c2mop:subclassp (find-class 'condition) (find-class 'error))
NIL
CL-USER> (c2mop:subclassp  (find-class 'error) (find-class 'condition))
T
PuercoPop
  • 6,707
  • 4
  • 30
  • 40