On Oct 22, 2007, at 11:26 PM, Allison Randal wrote:

Will Coleda (via RT) wrote:
$ ./parrot foo.pir
Method 'set_string_native' not found
current instr.: 'test' pc 20 (foo.pir:8)
We wanted to do this in Tcl to simplify TclConst, but were unable to. Presumably it's just that it's a vtable we're trying to super, not a method...

The problem here isn't with Super, it's with the call:

  $P4.'set_string_native'('urk')

You can't call a vtable function as a method. (That's a feature, not a bug. It allows Parrot classes to have low-level functionality that isn't visible from the HLLs.)

Whoops. Yup, makes sense.

Now, if you change that line to the more accurate PIR way of calling 'set_string_native':

   $P4 = 'urk'

Then you get the error:

  set_string_native() not implemented in class 'Super'

The Super PMC is, in many ways, an ancient attempt at implementing PMCProxy, and shows its age in spots. A real 'super' that crosses the boundary between high-level classes and low-level PMCs will have to wait until we finish the implementation of PDD 17 in January. The short-term hack for accessing the low-level PMC within the object is to grab the proxy object for that parent:

  $P4 = getattribute $P3, ['String'], 'proxy'
  $P4 = 'urk'

urk indeed. Yah, I wouldn't have gotten that from reading PDD15.

Allison

Thanks for the clarification; I'll patch tcl to use this idiom shortly!

This ticket can be rejected.

--
Will "Coke" Coleda
[EMAIL PROTECTED]


Reply via email to