***** D method override mechanisms borked ******

Dave Dave_member at pathlink.com
Sun Jun 25 13:08:35 PDT 2006


Lars Ivar Igesund wrote:
> Dave wrote:
> 
>>>
>> I think this can all be boiled down to 2 things:
>>
>> - Since D has chosen its OOP semantics to be based on those of Java, it
>> should follow that model consistently w.r.t. co/contra-variance (after
>> all it's seen pretty wide-spread use).
>>
>> - Even more importantly, make the darn protection attributes consistent
>> between structs, classes, modules and packages no matter if parts of
>> which are implemented with templates or not!
>>
>> - Dave
> 
> Actually, Walter has stated in the past that if Java and C++ do something
> differently, he choose the C++ way. Now that almost nothing work in a way

IMHO, that sounds like a good way to fall into the "corner case" trap - 
trying to merge C++ semantics w/ an OOP model more closely based on 
Java. I'd guess that probably the OP from Kris is a result of this 
(either way - if the rules were changed and/or the implementation is 
broken).

I'd generally agree about the 'C++ default', but preferable to trying to 
please both camps, a common and readily implementable (working!) 
'ground' must be found, even if Java programmers come out of this better 
than C++ programmers.

If programmers and compiler writers are going to switch from C++ to D, 
I'd say for #1 above that what has been proved to work (and most easily 
implementable [Java]) is most important to get v1 out the door. For #2, 
consistency is just vital even if it is not the particular way that C++ 
programmers are used to. Otherwise D's going to scare off all of the OOP 
purists, OOP newbies and compiler implementors all in one shot.

> that anyone understand, I think it might be time to start over with OOP
> semantics that is best for D, no matter how it is done in C++, Java or C#.
> 



More information about the Digitalmars-d-bugs mailing list