Jonathan Worthington wrote:
Hi,

As of r15039, :vtable and :vtable("...") are now both implemented.
See example code at the end of this email.

Awesome!

As of now, please use this new syntax. I have left in support for the
 old "__"-prefix lookup as plenty of old code is using it; please
note that if you have a :vtable("xxx") and a "__xxx" then the first
will be called, not the second.

Updating Punie went smoothly, but when I updated TGE::Rule:

-.sub __init :method
+.sub 'init' :method :anon :vtable

I got this error:

../../parrot -o TGE/Rule.pbc --output-pbc TGE/Rule.pir
error:imcc:'init' is not a v-table method, but was used with :vtable.

        in file 'TGE/Rule.pir' line 49


I'll leave it to Chip and/or Allison to decide how long the
deprecation cycle is for this.

Since it is so widely used, let's deprecate it two releases from now, so we can have one release with both options, and then deprecate it in the following release.

Implementation wise, at the moment I'm just storing these entries in
 "\0VTABLE\0" sub-namespace within the class namespace, however I'm
not sure I like this (feels like we got rid of one bit of namespace pollution by adding another, albeit a less noticeable one). I don't
see another way to attach the VTABLE namespace to the main one,
however. But that's an implementation detail - even if we change that
any :vtable-using code will go on working fine.

This is a good place to start, but I agree it's not what we want ultimately. Chip and I talked about attaching a data structure of vtable entries as a property on the namespace object.

Allison

Reply via email to