call-next-method
call-next-method &rest args → {result}*
args—an object. These are objects that are appropriate as args to the methods.
results—the values returned by the method it calls.
The function call-next-method can be used within the body forms (but not the lambda list) of a method defined by a method-defining form to call the next method.
If there is no next method, the generic function no-next-method is called.
The type of method combination used determines which methods can invoke call-next-method. The standard method combination type allows call-next-method to be used within primary methods and around methods. Barmar thinks this is not needed because it is said elsewhere (ch4.1). -kmp 22-Dec-90
The standard
\term{method combination}
type defines the next \term{method} as follows:
\beginlist
\itemitem{\bull}
If \funref{call-next-method} is used in an \term{around method},
the next \term{method} is the next most specific \term{around method}, if one is
applicable.
\itemitem{\bull}
If there are no \term{around methods} at all or if
\funref{call-next-method} is called by the least specific \term{around method},
other \term{methods} are called as follows:
\beginlist
\itemitem{--} All the \term{before methods} are called, in
most-specific-first order. \Thefunction{call-next-method}
cannot be used in \term{before methods}.
\itemitem{--}
The most specific primary \term{method} is called. Inside the body of a
primary \term{method}, \funref{call-next-method} can be used to pass control to
the next most specific primary \term{method}. The generic function
\funref{no-next-method} is called if \funref{call-next-method} is used and there
are no more primary \term{methods}.
\itemitem{--} All the \term{after methods} are called in
most-specific-last order. \Thefunction{call-next-method}
cannot be used in \term{after methods}.
\endlist
\endlistFor generic functions using a type of method combination defined by the short form of define-method-combination, call-next-method can be used in around methods only.
When call-next-method is called with no arguments, it passes the current method's original arguments to the next method. Neither argument defaulting, nor using setq, nor rebinding variables with the same names as parameters of the method affects the values call-next-method passes to the method it calls.
A sentence was removed here by Moon since it was duplicated below, and another sentence was moved to be next to the duplicate:
When call-next-method is called with arguments, the next method is called with those arguments.
If call-next-method is called with arguments but omits optional arguments, the next method called defaults those arguments.
Further computation is possible after \funref{call-next-method} returns.
The function call-next-method returns any values that are returned by the next method.
The function call-next-method has lexical scope and indefinite extent and can only be used within the body of a method defined by a method-defining form.
Whether or not call-next-method is fbound in the global environment is implementation-dependent; however, the restrictions on redefinition and shadowing of call-next-method are the same as for symbols in the common-lisp package which are fbound in the global environment. The consequences of attempting to use call-next-method outside of a method-defining form are undefined.
None.
defmethod, call-method, define-method-combination.
Grammar improved by Moon:
Removed per X3J13. -kmp 05-Oct-93 If \funref{call-next-method} is used in a \term{method} whose \term{method combination} does not support it, an error \oftype{control-error} is \term{signaled}.
When providing arguments to call-next-method, the following rule must be satisfied or an error of type error "is" => "should be" per X3J13. -kmp 05-Oct-93
isshould be signaled: the ordered set of applicable methods for a changed set of arguments for call-next-method must be the same as the ordered set of applicable methods for the original arguments to the generic function. Optimizations of the error checking are possible, but they must not change the semantics of call-next-method.
define-method-combination, defmethod, next-method-p, no-next-method, call-method, Section 7.6.6 (Method Selection and Combination), Section 7.6.6.2 (Standard Method Combination), Section 7.6.6.4 (Built-in Method Combination Types)
None.