Previous: , Up: Generic Procedures   [Contents][Index]

4.3 Effective Method Procedure

When a generic procedure is called, it arranges to invoke a subset of its methods. This is done by combining the selected methods into an effective method procedure, or EMP, then tail-recursively invoking the EMP. compute-effective-method-procedure is the procedure that is called to select the applicable methods and combine them into an EMP.

Procedure: compute-effective-method-procedure generic-procedure classes

Collects the applicable methods of generic-procedure by calling method-applicable? on each method and on classes. Combines the resulting methods together into an effective method procedure, and returns that EMP.

Procedure: compute-method generic-procedure classes

This procedure is like compute-effective-method-procedure, except that it returns the result as a method whose specializers are classes.

compute-method is equivalent to

(make-method classes
             (compute-effective-method-procedure generic-procedure