I tried
pmc.elements()
pmc."elements"()
pmc._elements()
pmc.__elements()
But it did not work...
In fact, what I really want to do, for debugging purposes, is to add a
custom method in the FixedBooleanArray.pmc (e.g get_allocated_size() ) and
be able to call it
from PIR test code.
Thanks
Karl Forner
Exactly. Due to asymmetry of methods and vtables, the latter are not
accessible as methods. You have to use the equivalent opcode:
$I0 = elements ar_pmc
But you can code a PIR wrapper for it:
.namespace ['FixedBooleanArray']
.sub 'elements' :method
$I0 = elements self
.return ($I0)
.end
usable as:
$I0 = ar_pmc.'elements'()
> In fact, what I really want to do, for debugging purposes, is to add a
> custom method in the FixedBooleanArray.pmc (e.g get_allocated_size() ) and
> be able to call it
> from PIR test code.
As you need PMC internals for this, you'd have to add it to the .pmc itself
(temporarely):
METHOD INTVAL get_allocated_size() {
return PMC_int_val2(SELF); /* or whatever */
}
> Thanks
> Karl Forner
HTH,
leo
great, exactly what I needed
thanks
karl