29.8. Specializers

29.8.1. Inheritance Structure of Specializer Metaobject Classes
29.8.2. Introspection
29.8.2.1. Function CLOS:EQL-SPECIALIZER-OBJECT
29.8.3. Initialization
29.8.3.1. Function CLOS:INTERN-EQL-SPECIALIZER
29.8.4. Updating Dependencies
29.8.4.1. Generic Function CLOS:SPECIALIZER-DIRECT-METHODS
29.8.4.2. Generic Function CLOS:SPECIALIZER-DIRECT-GENERIC-FUNCTIONS
29.8.4.3. Generic Function CLOS:ADD-DIRECT-METHOD
29.8.4.4. Generic Function CLOS:REMOVE-DIRECT-METHOD

29.8.1. Inheritance Structure of Specializer Metaobject Classes

Figure 29.6. Inheritance structure of specializer metaobject classes

Inheritance structure of specializer metaobject classes

29.8.2. Introspection

29.8.2.1. Function CLOS:EQL-SPECIALIZER-OBJECT

Syntax
(CLOS:EQL-SPECIALIZER-OBJECT eql-specializer)
Arguments
eql-specializer
an EQL specializer metaobject.
Value
an object.
Purpose

This function returns the object associated with eql-specializer during initialization. The value is guaranteed to be EQL to the value originally passed to CLOS:INTERN-EQL-SPECIALIZER, but it is not necessarily EQ to that value.

This function SIGNALs an ERROR if eql-specializer is not an EQL specializer.

29.8.3. Initialization

29.8.3.1. Function CLOS:INTERN-EQL-SPECIALIZER

Syntax
(CLOS:INTERN-EQL-SPECIALIZER object)
Arguments
object
any Lisp object.
Values
The EQL specializer metaobject for object.
Purpose
This function returns the unique EQL specializer metaobject for object, creating one if necessary. Two calls to CLOS:INTERN-EQL-SPECIALIZER with EQL arguments will return the same (i.e., EQ) value.

Remarks. The result of calling CLOS:EQL-SPECIALIZER-OBJECT on the result of a call to CLOS:INTERN-EQL-SPECIALIZER is only guaranteed to be EQL to the original object argument, not necessarily EQ.

29.8.4. Updating Dependencies

29.8.4.1. Generic Function CLOS:SPECIALIZER-DIRECT-METHODS

Syntax
(CLOS:SPECIALIZER-DIRECT-METHODS specializer)
Arguments
specializer
a specializer metaobject.
Value
A possibly empty list of method metaobjects.
Purpose
This generic function returns the possibly empty set of those methods, connected to generic functions, which have specializer as a specializer. The elements of this set are method metaobjects. This value is maintained by the generic functions CLOS:ADD-DIRECT-METHOD and CLOS:REMOVE-DIRECT-METHOD.

Methods

(CLOS:SPECIALIZER-DIRECT-METHODS (specializer CLASS))

No behavior is specified for this method beyond that which is specified for the generic function.

This method cannot be overridden unless the following methods are overridden as well:

(CLOS:SPECIALIZER-DIRECT-METHODS (specializer CLOS:EQL-SPECIALIZER))
No behavior is specified for this method beyond that which is specified for the generic function.

29.8.4.2. Generic Function CLOS:SPECIALIZER-DIRECT-GENERIC-FUNCTIONS

Syntax
(CLOS:SPECIALIZER-DIRECT-GENERIC-FUNCTIONS specializer)
Arguments
specializer
a specializer metaobject.
Value
A possibly empty list of generic function metaobjects.
Purpose
This generic function returns the possibly empty set of those generic functions which have a method with specializer as a specializer. The elements of this set are generic function metaobjects. This value is maintained by the generic functions CLOS:ADD-DIRECT-METHOD and CLOS:REMOVE-DIRECT-METHOD.

Methods

(CLOS:SPECIALIZER-DIRECT-GENERIC-FUNCTIONS (specializer CLASS))

No behavior is specified for this method beyond that which is specified for the generic function.

This method cannot be overridden unless the following methods are overridden as well:

(CLOS:SPECIALIZER-DIRECT-GENERIC-FUNCTIONS (specializer CLOS:EQL-SPECIALIZER))
No behavior is specified for this method beyond that which is specified for the generic function.

29.8.4.3. Generic Function CLOS:ADD-DIRECT-METHOD

Syntax
(CLOS:ADD-DIRECT-METHOD specializer method)
Arguments
specializer
a specializer metaobject.
method
a method metaobject.
Values
The values returned by this generic function are unspecified.
Purpose

This generic function is called to maintain a set of backpointers from a specializer to the set of methods specialized to it. If method is already in the set, it is not added again (no ERROR is SIGNALed).

This set can be accessed as a list by calling the generic function CLOS:SPECIALIZER-DIRECT-METHODS. Methods are removed from the set by CLOS:REMOVE-DIRECT-METHOD.

The generic function CLOS:ADD-DIRECT-METHOD is called by ADD-METHOD whenever a method is added to a generic function. It is called once for each of the specializers of the method. Note that in cases where a specializer appears more than once in the specializers of a method, this generic function will be called more than once with the same specializer as argument.

The results are undefined if the specializer argument is not one of the specializers of the method argument.

Methods

(CLOS:ADD-DIRECT-METHOD (specializer CLASS) (method METHOD))

This method implements the behavior of the generic function for class specializers.

No behavior is specified for this method beyond that which is specified for the generic function.

This method cannot be overridden unless the following methods are overridden as well:

(CLOS:ADD-DIRECT-METHOD (specializer CLOS:EQL-SPECIALIZER) (method METHOD))

This method implements the behavior of the generic function for EQL specializers.

No behavior is specified for this method beyond that which is specified for the generic function.

29.8.4.4. Generic Function CLOS:REMOVE-DIRECT-METHOD

Syntax
(CLOS:REMOVE-DIRECT-METHOD specializer method)
Arguments
specializer
a specializer metaobject.
method
a method metaobject.
Values
The values returned by this generic function are unspecified.
Purpose

This generic function is called to maintain a set of backpointers from a specializer to the set of methods specialized to it. If method is in the set it is removed. If it is not, no ERROR is SIGNALed.

This set can be accessed as a list by calling the generic function CLOS:SPECIALIZER-DIRECT-METHODS. Methods are added to the set by CLOS:ADD-DIRECT-METHOD.

The generic function CLOS:REMOVE-DIRECT-METHOD is called by REMOVE-METHOD whenever a method is removed from a generic function. It is called once for each of the specializers of the method. Note that in cases where a specializer appears more than once in the specializers of a method, this generic function will be called more than once with the same specializer as argument.

The results are undefined if the specializer argument is not one of the specializers of the method argument.

Methods

(CLOS:REMOVE-DIRECT-METHOD (specializer CLASS) (method METHOD))

This method implements the behavior of the generic function for class specializers.

No behavior is specified for this method beyond that which is specified for the generic function.

This method cannot be overridden unless the following methods are overridden as well:

(CLOS:REMOVE-DIRECT-METHOD (specializer CLOS:EQL-SPECIALIZER) (method METHOD))

This method implements the behavior of the generic function for EQL specializers.

No behavior is specified for this method beyond that which is specified for the generic function.


These notes document CLISP version 2.49.60+Last modified: 2017-11-21