On Tuesday 08 May 2007 13:38:31 Alek Storm wrote: > It works exactly the same way as 'add_method' - this is the way the new > object system works, as defined in PDD15. Since this makes :vtable > pointless, I think we should get rid of it.
With :vtable, you define a sub of the appropriate name and use the :vtable attribute. Without :vtable, you define a sub of any name, add :anon so as not to pollute your namespace, somehow magically get that sub in a PMC, get the appropriate class in a PMC, and then call add_method on that class object with the sub object, being sure to do all of this at load or instantiation time so that people can use the right vtable entry any time during the program. Assuming that :vtable adds the invocant and does not pollute the namespace, the first option is, to me, clearly valuable. -- c