Overloading/Inheritance issue

Marcin Kuszczak aarti at interia.pl
Sat Aug 4 03:48:05 PDT 2007


Walter Bright wrote:

> Aarti_pl wrote:
>> ... and it's even not consistent with one of D design rules:
>> 
>> "If something looks similar as in C++, it should behave similar to C++."
>> 
>> I think that breaking this rule is main source of confusion here. In my
>> opinion it would be much better for D to implement inheritance in a way
>> similar to other C-like languages.
> 
> It does behave, in this instance, just like C++. Steve is asking for the
> Java behavior.

Yes you are right. I found that I was wrong just after Regan post with old
threads concerning this issue.

There must be some other rule broken in this case, because I didn't know
that in C++ behaviour is same. :-) Probably rule which is broken is just...
programmer intuition...

Although current behaviour is not very intuitive I can live with it (knowing
that there are arguments against intuitive behaviour). I think that it
would be good idea to document it better (including few arguments why it
was chosen over Java style behaviour).

-- 
Regards
Marcin Kuszczak (Aarti_pl)
-------------------------------------
Ask me why I believe in Jesus - http://zapytaj.dlajezusa.pl (en/pl)
Doost (port of few Boost libraries) - http://www.dsource.org/projects/doost/
-------------------------------------




More information about the Digitalmars-d mailing list