Package: closer-mop

Function ensure-class

Lambda List

ensure-class (name &rest args)


The name argument is a symbol.
Some of the keyword arguments accepted by this function are actually processed by ensure-class-using-class, others are processed during initialization of the class metaobject (as described in the section called "Initialization of Class Metaobjects").

Return Value

The result is a class metaobject.


This function is called to define or redefine a class with the specified name, and can be called by the user or the implementation. It is the functional equivalent of defclass, and is called by the expansion of the defclass macro.

The behavior of this function is actually implemented by the generic function ensure-class-using-class. When ensure-class is called, it immediately calls ensure-class-using-class and returns that result as its own.

The first argument to ensure-class-using-class is computed as follows:
  • If name names a class (find-class returns a class when called with name) use that class.
  • Otherwise use nil.
The second argument is name. The remaining arguments are the complete set of keyword arguments received by the ensure-class function.