On Jul 24, 2013, at 12:30 , Nick Wellnhofer <[email protected]> wrote:

> On Jul 24, 2013, at 01:09 , Marvin Humphrey <[email protected]> wrote:
> 
>> A more robust approach might be to default to generating bindings whenever
>> possible for every class and every method in a parcel.  (C types which cannot
>> be mapped automatically, such as `int*`, prevent some methods from being 
>> bound
>> automatically.)  This will cost us in terms of compiled object size and build
>> time, but it's conceptually simpler and will cut down on weird edge cases 
>> like
>> the one we have to disentangle now.
> 
> I think that's the best solution. We've been generating bindings for most 
> methods anyway.

This is now implemented in branch 'perl-method-bindings'.

Looking at the code in CFCPerlClass_method_bindings, another question turned 
up. Currently, the Perl bindings generate XSubs for every fresh method to 
support SUPER:: invocations from Perl. But I can't see a legitimate use case 
where this would be needed. In my opinion, it only makes sense to invoke a 
method of a superclass on the 'self' object from a subclass. In this case, it 
would be enough to have a single XSub per novel method which uses dynamic 
dispatch. Things like $arbitrary_object->SUPER::method() wouldn't be possible, 
but this looks error-prone to me anyway. No sane code should do that. For 
example, languages like Java don't allow that at all.

Nick

Reply via email to