Sam Ruby <[EMAIL PROTECTED]> wrote:
> Dan Sugalski wrote:

[ method lookup ]

> Parrot_CompositeObject_find_method should do that.  object.c should not.

I think, when going down the class hierarchy, we just have to call
class->vtable->find_method() again, istead of the Parrot_find_global.

> And, yes, the PMC's for all the "core" and "dynclass" are indexed for
> convenient access.  But, in any case, there should be a "new_p_p" opcode
> which should do a $1=$2->vtable->instantiate(interpreter);

That is exactly what is currently PObj = Pclass->vtable->new_extended().

>> All objects also must be able to perform the method:
>>
>>     get_anonymous_subclass - to put the object into a singleton anonymous
>>                              subclass

> Sorry, you lost me here.

A singleton object is the sole instantiation of a class. You'll always
get that one object.

> Yes, MMD is the big elephant in the room.  A commit later today will
> create a PyComplex and PyLong that (for the moment) is a wholesale clone
> of Complex and BigInt respectively simply because I wanted to override a
> few methods and couldn't figure out how to get MMD to behave the way I
> wanted.  Obviously, this will need to be refactored later.

We need multiple inheritance for PMCs. A PyComplex isa(PyObject,
Complex) PMC. There is minimal support for that - used in the
OrderedHash PMC. But the PMC compiler should be more clever:

  void add(...) {
    MMD_PyComplex: {
      Complex.SELF.add(...);
    }

should install the MMD subroutine for the complex PMC
  Parrot_Complex_add_Complex()

> - Sam Ruby

leo

Reply via email to