Common Lisp Package: MOP-UTILS

A set of Metaobject Protocol utilities.

README:

FUNCTION

Public

CLASS-NAME-OF (OBJECT)

The class-name of the class of OBJECT.

GET-SLOT-BY-NAME (CLASS NAME)

Get slot whose name is `NAME' from `CLASS'.

GET-SLOT-OF-BY-NAME (OBJECT NAME)

Get slot whose name is `NAME' of the class of `OBJECT'.

SLOT-NAMES-OF (OBJECT)

List of names of the slots of OBJECT.

SLOTS-OF (OBJECT)

List of slots of OBJECT.

MACRO

Public

DEFMETACLASS (METACLASS SUPERS SLOT-DEFINITIONS &BODY BODY)

Macro for easy metaclass definition. It takes all the options DEFCLASS takes, plus the following: - :VALIDATE-SUPERCLASSES, classes for which VALIDATE-SUPERCLASS methods (with METACLASS in the subclass position) will be created. - :VALIDATE-SUBCLASSES, a list of classes for which VALIDATE-SUPERCLASS methods (with METACLASS in the superclass position) will be created. - :SLOT-FIXTURES, a list of classes from which EFFECTIVE-SLOT-DEFINITION and DIRECT-SLOT-DEFINITION should inherit. This class should already exist at the time DEFMETACLASS is called. DEFMETACLASS apart from creating the metaclass defines some additional things: - The classes <METACLASS>-DIRECT-SLOT-DEFINITION and <METACLASS>-EFFECTIVE-SLOT-DEFINITION (where <METACLASS> should be substituted by METACLASS), which inherit from the fixtures and STANDARD-CLASS-DIRECT-SLOT-DEFINITION and STANDARD-CLASS-EFFECTIVE-SLOT-DEFINITION, respectively. - The methods DB-CLASS-{DIRECT|EFFECTIVE}-SLOT-DEFINITION.

DO-CHILDREN ((VAR CLASS-NAME) &BODY BODY)

For every subclass of class named by CLASS-NAME, execute BODY with VAR bind to it.

DO-MACRO-FOR-CHILDREN (MACRO CLASS-NAME)

Use MACRO with the names of all the subclasses of the class named by CLASS-NAME.