Previous: Method Storage, Up: Generic Procedures


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
                                                           classes))