So, as I dive into PDD15 as promised and get objects spec'd out so they can finally be implemented, I've come across the problem of method resolution.

We've got, or will have, two ways to invoke methods. The first is a simple:

callmethod "methodname"

which calls the named method on the object in the object slot, does all the funky lookups and whatnot, and slams the method PMC into the . That's fine. May even mandate a:

callmethod Pobject, "methodname"

which'll move the object to the object slot. Or not. But that's beside the point.

We also have to have a way to fetch the method PMC for a named method for later use, which is where the interesting bits come in.

This is required for a number of reasons, including Python, so we have to have it. The question is... *When* is the name resolved? That is, if we do:

findmethod P4, Pobject, "methodname"

does the method PMC that gets stuck in P4 represent the method "methodname" for the object *at that point in time* or does it represent the method *at the time it is invoked*? That is, do we defer actual lookup until invocation, or do we resolve at method find time?

This has some implications for when methods are overridden and namespaces swapped in and out, so it's (unfortunately) not an academic exercise.
--
Dan


--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to