Piers Cawley <[EMAIL PROTECTED]> wrote:
> Leopold Toetsch <[EMAIL PROTECTED]> writes:

>> Piers Cawley <[EMAIL PROTECTED]> wrote:
>>> Leopold Toetsch <[EMAIL PROTECTED]> writes:
>>
>>>> The terms are misleading a bit here.
>>>> - a ParrotClass isa delegate PMC
>>>> - a ParrotObject isa ParrotClass
>>>     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>     That definitely seems to be the wrong way 'round.
>>
>> Why? A ParrotClass is responsible for the method dispatch. The ParrotObject
>> inherits that behavior.

> But logically, a Class is an Object, and an object is an *instance* of a
> class.

Sure. The HLL class C<isa> ParrotClass PMC object. The HLL object is the
instantiation of it. Please note that C<ParrotObject> is the underlying
PMC, which can't be instantiated directly.

> ... Surely a class should be responsible for storing and finding
> method, but some other thing, call it a Dispatcher object

or the metaclass object?

> Of course, if you have OO languages that have weird dispatch rules, you
> might need to have multiple dispatchers hanging around but (I'd argue)
> you're still better attaching them to classes using composition rather
> than inheritance.

The C<isa> relationship inside PMCs is just a way to define that missing
vtable functions are filled in with the parent's function. You an think
of that the PMCs (ParrotObject, ParrotClass, delegate, and possibly
mmd_default) together build the metaclass object (or dispatcher in your
terms). The ParrotObject PMC just holds the necessary information to
instantiate the HLL object.

leo

Reply via email to