[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: method-lambda and apply-method-lambda

I am not even going to try to yank in all the relevant parts of all
these messages and match them up where they meet.  After talking to
Patrick on the phone and thinking long and hard about what he was
proposing, I now believe it can work and is a good idea.  So this
message just summarizes what I believe is a correct proposal.

make-method-function (generic-function method lambda-list body)

This is a generic function.  It tends to be specialized on the class of
the generic-function and method arguments.  The returned result
satisfies the criterion outlined by Moon in one of his messages.

apply-method-function generic-function method function info &rest args

This is also a generic function.  It tends to be specialied on its first
two arguments as well.  For the case where generic-function and method
are both standard, the info argument is a list of the next methods.

Each of these functions are generic on both the generic-function and the
method to reflect the fact that both are involved in determining the
method calling contract.

The metacircularity can bottom out without problems because the
standard-method on compute discriminator code can tell than any of the
calls it should make to apply-method-function will actually end up
invoking the standard method and so it can short circuit the call to the
actual generic function.  User code which wants real high method lookup
performance will end up having to do something similar to the extent it
wants to support this piece of the method lookup protocol.  We will not
provide any mechanisms to make this easy.

As far as the interaction with `combined methods' goes I think its quite
simple.  Make-method-call actually expands something like this:

(progn (make-method-call #<m1>))

(progn (apply-method-function #<GF> #<M1> #<FN> (method list) .args.))

The actual function (maybe called make-method-function) which converts
the effective method form into something else takes care doing this
expansion of make-method-call of course.  But that function is not
documented needless to say.

I also don't think we should have a function like handler-for.  I think
that is too implementation specific.