Lucifers,

CFCPerlClass_method_bindings in CFCPerlClass.c currently generates XSubs for overridden methods. The comment states:

    /* Create the binding, add it to the array.
     *
     * Also create an XSub binding for each override.  Each of these
     * directly calls the implementing function, rather than invokes the
     * method on the object using vtable method dispatch.  Doing things
     * this way allows SUPER:: invocations from Perl-space to work
     * properly.
     */

While this is true, I fail to see a practical use case. IMO, the only place where calling a supermethod makes sense is in the method implementation of a subclass. Everywhere else the result is mostly unpredictable. Even if you know exactly where methods are overridden, this could change in a later version. Apart from that, why would you ever want to invoke a super method?

In a method of a Perl subclass, a SUPER:: invocation (of the same method) would still work if we only created a single XSub with virtual dispatch. So what about removing XSubs for overridden methods?

Nick


Reply via email to