override(T)

Max Samukha spambox at d-coding.com
Thu Sep 24 09:32:57 PDT 2009


On Thu, 24 Sep 2009 23:55:57 +0800, Lionello Lunesu
<lio at lunesu.remove.com> wrote:

>Daniel Keep wrote:
>> Why not go with what C# uses?
>> 
>> class LotterySimulation : Lottery, Figure {
>>     override void Lottery.draw();
>>     override void Figure.draw();
>> }
>> 
>> Just seems like a more obvious and natural place for it to me.  D
>> already uses this to disambiguate symbols in other places.
>
>I actually like Andrei's suggestion a lot more! It's far more natural:
>try reading both versions out loud.

C# uses familiar syntax to qualify the function name. I think it's
natural enough.

>
>Making it look like C# has bad sides too. Explicit overriding in C#
>always hides the member from the public view. So this "like C#" can
>easily backfire.

According to Andrei's suggestion, the implemented functions are
effectively hidden. You can call them only through the interfaces.

>
>++andreis_suggestion;

I give my vote to C#'s syntax if D can adopt it.
>
>L.




More information about the Digitalmars-d mailing list