Matt Fowles <[EMAIL PROTECTED]> wrote:
> Leo~

> On Tue, 18 Jan 2005 16:52:52 +0100, Leopold Toetsch <[EMAIL PROTECTED]> wrote:

>> That was C<vtable->dispatch> in the proposal. C<find_method> is just
>> called to query one object or class, if it can do the method. Finding
>> the final (MMD) function is done separately with a distinct vtable
>> method (and probably implemented inside some meta class PMC).

> That makes sense.  If the vtable->dispatch method is attatched to some
> PMC, what provides that PMC?

That PMC is the metaclass PMC of the class system. For standard Parrot
objects that's mostly default.pmc or parrotclass.pmc and/or an
implementation in src/objects.c.

> ... Is it the MMD function being called
> (what I would suggest), some environmental one, or something else?

Given a P6 function call (which can be MMD or not):

  foo($a, $b, $c)

If nothing is kwnown about "foo", this would be basically:

  func = a.dispatch("foo")    # VTABLE_dispatch(interp, a, "foo")
  invokecc func

That ends up in default.pmc's implementation normally, which calls
C<find_method> repeatedly according to C<vtable->mro> and the algorithm
described in "MMD and VTABLE_find_method".

> Matt

leo

Reply via email to