Klaas-Jan Stol wrote:
in PIR you can override (or implement) a vtable method using the :vtable
flag.
before that, in the past, this was done by prefixing the vtable name with 2
underscores.

While ack'ing for ".constant" (to be replaced with .macro_const), I found
that the following file defines constants for all entries:

runtime/parrot/include/vtable_methods.pasm

for instance:
9:.constant PARROT_VTABLE_ADD_INT_METHNAME      "__add_int"

2 questions arise:

1. is the double__underscore thing still supposed to work and if so, is it
deprecated?


double__underscore still the only way to overload a non-vtable method, for example, the opcode add (with MMD) :

.namespace [ 'MyInteger' ]

.sub 'set_integer_native' :vtable :method
    .param int val
    ...
.end

.sub '__add' :multi(MyInteger, MyInteger) :method
    .param pmc val
    .param pmc dest
    ...
.end

François.

2. are the .constant definitions still needed? i.o.w., does updating that
file make sense or can i save myself that trouble.



thanks,
kjs



Reply via email to