Next: , Previous: , Up: multimethods   [Index]


19.7 Invoking the next method

The library (vicare language-extensions multimethods) makes use of parameters to implement the “next method” facility5; this allows, for example, functions from foreign libraries to be used directly as methods, through add-method. The bindings are available also to code outside the method implementations, but this is not a big problem.

Function: call-next-method

Call the next most specific method.

Function: next-method?

Return true if a next method is available.


Footnotes

(5)

A “traditional” way to make the bindings call-next-method and next-method? available in the body of methods (rejected by this implementation) is to add two arguments to the function at expand time; the following method function:

(lambda (arg1 arg2)
  ---)

is changed to:

(lambda (call-next-method next-method? arg1 arg2)
  ---)

this way the bindings are available only to the methods. This implementation requires the source syntax object of the method to be available at expansion time, and to hold a lambda form.