petdance/scratch — Issue #877: need ability to dispatch to parent's method or vtable from PIR
Author: petdance
Created: 2011-11-14 06:13:50+00:00
State: open
Labels: Pri-normal, rfc, Sev-medium

If you write a class in PIR, you can access certain ancestral methods/vtables by getting the 'proxy' attribute for that ancestor, with two big limitations.
you need to know the name of the ancestor that implements the vtable (this isn't always your direct parent.)

that ancestor MUST be a PMC (not another class.)

Since there is no generic mechanism to invoke a vtable by name, we should probably continue to use a proxy object to access this functionality.

perhaps:

```
# INT values only!
.sub set_pmc_keyed :vtable
.param pmc key
.param pmc value
$I0 = value
.local pmc proxy
proxy = get_proxy self
proxy[key] = $I0
.end
```

Bikeshed away. Tcl needs this or something like it to fully implement the trace builtin. (which basically lets us run code before and after each vtable access.)

Originally http://trac.parrot.org/parrot/ticket/1165 by @coke