ensure-generic-function-using-class generic-function-or-nil function-name &key :argument-precedence-order :declarations :documentation :generic-function-class :lambda-list :method-class :method-combination :name &allow-other-keys => generic-function

Arguments and values:


-- A generic function metaobject nil.

function-name -- A symbol or a list of the form (setf symbol).

:generic-function-class -- A class metaobject or a class name. If it is not supplied, it defaults to the class named standard-generic-function. If a class name is supplied, it is interpreted as the class with that name. If a class name is supplied, but there is no such class, an error is signaled.

For the interpretation of additional keyword arguments, see ``Initialization of Generic Function Metaobjects''.

generic-function -- A generic function metaobject.


The generic function ensure-generic-function-using-class is called to define or modify the definition of a globally named generic function. It is called by the ensure-generic-function function. It can also be called directly.

The first step performed by this generic function is to compute the set of initialization arguments which will be used to create or reinitialize the globally named generic function. These initialization arguments are computed from the full set of keyword arguments received by this generic function as follows:

If the generic-function-or-nil argument is nil, an instance of the class specified by the :generic-function-class argument is created by calling make-instance with the previously computed initialization arguments. The function name function-name is set to name the generic function. The newly created generic function metaobject is returned.

If the class of the generic-function-or-nil argument is not the same as the class specified by the :generic-function-class argument, an error is signaled.

Otherwise the generic function generic-function-or-nil is redefined by calling the reinitialize-instance generic function with generic-function-or-nil and the initialization arguments. The generic-function-or-nil argument is then returned.


ensure-generic-function-using-class (generic-function generic-function) function-name &key :generic-function-class &allow-other-keys
ensure-generic-function-using-class (generic-function null) function-name &key :generic-function-class &allow-other-keys