Implementing multiple inheritance in D

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon May 9 11:36:08 PDT 2011


On 5/9/11 12:43 PM, kenji hara wrote:
> I have tried to implement multiple inheritance in D.
>
> My first idea is binary inheritance tree with using alias this, but
> current dmd doesn't look alias this on superclasses.
> So I have tried to fix this behavior.
> ->  https://github.com/9rnsr/dmd/tree/MultiInheritPatch
>
> Result:
> ->  http://ideone.com/iD4JE
>
> Some issues:
> - Calling constructors of superclasses syntax.
> - Object layout (share __monitor object? reduce overhead?)
>
> Do you think?

This is very interesting. I don't understand the example though (some is 
commented out, some is in, and I'm unclear on what didn't use to work 
and what works). Also I can't find the important commits in your branch, 
so it may be best to organize those as one pull request for the dmd 
mainline.

Could you please provide more detail on what you fixed and what the 
resulting context is?


Thanks,

Andrei


More information about the Digitalmars-d mailing list