Package: closer-mop

Generic Function validate-superclass

Lambda List

validate-superclass (class superclass)


The class argument is a class metaobject.
The superclass argument is a class metaobject.

Return Value

This generic function returns true or false.


This generic function is called to determine whether the class superclass is suitable for use as a superclass of class.

This generic function can be be called by the implementation or user code. It is called during class metaobject initialization and reinitialization, before the direct superclasses are stored. If this generic function returns false, the initialization or reinitialization will signal an error.


validate-superclass ((class class) (superclass class))
This method returns true in three situations:
  • If the superclass argument is the class named t,
  • if the class of the class argument is the same as the class of the superclass argument or
  • if the classes one of the arguments is standard-class and the class of the other is funcallable-standard-class.
In all other cases, this method returns false.

This method can be overridden.


Defining a method on validate-superclass requires detailed knowledge of the internal protocol followed by each of the two class metaobject classes. A method on validate-superclass which returns true for two different class metaobject classes declares that they are compatible.