On 5/8/07, Will Coleda <[EMAIL PROTECTED]> wrote:
How would one implement a vtable method, (referring to self), and then add it to the object? You'd have to add an ":init :load :anon" block after the vtable was defined in order to invoke add_vtable_method, and you'd need a reference to the invokable you're adding, which means you'd have to leave it lying about in a namespace somewhere so you could extract it. So, I think keeping a compile time directive like :vtable around is still a good idea.
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.
Because I was unsure exactly how the > interface is going to end up, 'add_method' also adds vtable methods also, if > :vtable is set on the method. If we decide to go with this interface, I'd > like to take it out, along with the :vtable pragma. > > Trying to override 'mark', 'destroy', or 'morph' throws an exception, > because overriding them might be dangerous. An exception is also thrown for > 'init_pmc', see below. (morph) FYI, there are dynamic PMCs that already override morph, for good or evil.
Allowing 'morph' is possible. Let's see what others think. -- Alek Storm