[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
4. MOP Specification
For an introduction to metaobjects and the metaobject protocol, see Metaobjects and the Metaobject Protocol.
The aim of the MOP specification in this chapter is to specify all the customizable generic function invocations that can be made by the standard GOOPS syntax, procedures and methods, and to explain the protocol for customizing such invocations.
A generic function invocation is customizable if the types of the arguments to which it is applied are not all determined by the lexical context in which the invocation appears. For example,
-
the
(initialize instance initargs)
invocation in the defaultmake-instance
method is customizable, because the type of theinstance
argument is determined by the class that was passed tomake-instance
. -
the
(make <generic> #:name ',name)
invocation indefine-generic
is not customizable, because all of its arguments have lexically determined types.
When using this rule to decide whether a given generic function invocation is customizable, we ignore arguments that are expected to be handled in method definitions as a single “rest” list argument.
For each customizable generic function invocation, the invocation protocol is explained by specifying
- what, conceptually, the applied method is intended to do
- what assumptions, if any, the caller makes about the applied method's side effects
- what the caller expects to get as the applied method's return value.
4.1 Class Definition | ||
4.2 Instance Creation | ||
4.3 Class Redefinition | ||
4.4 Method Definition | ||
4.5 Generic Function Invocation |