www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - multiple inheritance

reply Stefan <Stefan_member pathlink.com> writes:
could anyone please direct me to a discussion about dropping multiple
inheritance?
I'm sure this has been on the forum in the past but I can't find a search
function.

I consider multiple and virtual inheritance an important feature. dropping it
means dropping a part of type safety, among other things.

thank you,
Stefan
Jan 18 2005
next sibling parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Stefan wrote:

 could anyone please direct me to a discussion about dropping multiple
 inheritance?
 I'm sure this has been on the forum in the past but I can't find a search
 function.
You could try Thunderbird, which has an excellent news search function ? http://www.mozilla.org/products/thunderbird/
 I consider multiple and virtual inheritance an important feature. dropping it
 means dropping a part of type safety, among other things.
D now has a single-rooted Object hierarchy, and the mixin feature. Along with interfaces, that should cover *most* cases of using MI ? http://www.digitalmars.com/d/overview.html says:
 Features To Drop
 Multiple inheritance. It's a complex feature of debatable value.
 It's very difficult to implement in an efficient manner, and compilers
 are prone to many bugs in implementing it. Nearly all the value of MI can
 be handled with single inheritance coupled with interfaces and aggregation.
 What's left does not justify the weight of MI implementation.
So I don't think that it will be in D, any more than it is in Java ? Just as with the C++ references (&), there are a few cases left. But they haven't been deemed important to change the language... --anders
Jan 18 2005
prev sibling parent J C Calvarese <jcc7 cox.net> writes:
In article <csigv7$l8v$1 digitaldaemon.com>, Stefan says...
could anyone please direct me to a discussion about dropping multiple
inheritance?
I'm sure this has been on the forum in the past but I can't find a search
function.
Try this: http://www.digitalmars.com/advancedsearch.html Also, Wiki4D is searchable: http://www.prowiki.org/wiki4d/wiki.cgi?Search
I consider multiple and virtual inheritance an important feature. dropping it
means dropping a part of type safety, among other things.
It's not so much that multiple inheritence has been dropped from D. It's more that it was never added. ;) Here's a short explanation why D doesn't have MI: http://www.digitalmars.com/drn-bin/wwwnews?D/67 And here's some code that shows how the lack of MI might be worked-around: http://www.digitalmars.com/drn-bin/wwwnews?D/25856 I'm sure there's a lot more discussion about MI out there, but I'll leave for you to find it if you really want to beat that old dead horse. :)
thank you,
Stefan
jcc7
Jan 18 2005