Package: closer-mop
Function ensure-generic-function
Lambda List
ensure-generic-function (fun-name &rest all-keys &key environment definition-source &allow-other-keys)
Arguments
Return Value
The result is a generic function metaobject.
Details
This function is called to define a globally named generic function or to
specify or modify options and declarations that pertain to a globally named
generic function as a whole. It can be called by the user or the
implementation.
It is the functional equivalent of defgeneric, and is called by the expansion of the defgeneric and defmethod macros.
The behavior of this function is actually implemented by the generic function ensure-generic-function-using-class. When ensure-generic-function is called, it immediately calls ensure-generic-function-using-class and returns that result as its own.
The first argument to ensure-generic-function-using-class is computed as follows:
It is the functional equivalent of defgeneric, and is called by the expansion of the defgeneric and defmethod macros.
The behavior of this function is actually implemented by the generic function ensure-generic-function-using-class. When ensure-generic-function is called, it immediately calls ensure-generic-function-using-class and returns that result as its own.
The first argument to ensure-generic-function-using-class is computed as follows:
- If function-name names a non-generic function, a macro, or a special form, an error is signaled.
- If function-name names a generic function, that generic function metaobject is used.
- Otherwise, nil is used.