Am Sonntag, 5. November 2006 15:22 schrieb Patrick R. Michaud:
> I don't think that's possible, is it?  Match is implemented as a
> subclass of Capture, as in:
>
>     $P0 = subclass 'Capture', 'Match'
>
> So, I can create the missing cases, but what do I put for the body
> of the method to get to the corresponding method of Capture?
>
>     .namespace [ 'Match' ]
>     .sub set_integer_keyed_int :vtable
>         .param int key
>         .param int value
>
>         # ... how to do set_integer_keyed_int method of Capture?
>
>     .end

A subclass of a PMC delegates to that PMC (via deleg_pmc.pmc). The PMC is the 
first attribute of that class named '__value'. Your code would look like:

  .local pmc capt
  capt = getattribute SELF, '__value'
  capt[key] = value

But this is all clumsy, and might/should change.

Therefore I've ci'ed in r15111 another workaround in parrotobject.pmc, which 
checks, if the parent isa PMC and in that case calls the deleg_pmc method 
instead of the default.

leo

Reply via email to