Multiple subtyping with alias this and nested classes

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat Oct 3 09:23:19 PDT 2009


Leandro Lucarella wrote:
> Andrei Alexandrescu, el  2 de octubre a las 19:10 me escribiste:
>> Leandro Lucarella wrote:
>>> We might have very different taste, but I find that a little... horrible.
>>> What do you have against mixins? I think you're trying to use D as C++ :)
>> If mixins work better, all the better. How would you use them to
>> achieve multiple inheritance?
> 
> Don't design with multiple inheritance in mind, use interfaces + mixins
> for common functionality instead.

But you're just saying it. I think you'd agree I wouldn't just follow 
that dogma noncritically just because you told me what to do.

I don't think many people design with multiple inheritance in mind. They 
design aiming at a good design. In my experience, some designs can make 
gainful use of multiple inheritance of classes, and some of my best 
designs do use multiple inheritance simply because it was the best tool 
for the job. Scala supports that with mixins, D supports that with 
multiple subtyping.


Andrei




More information about the Digitalmars-d mailing list