Daniel Keep wrote:

Andrei Alexandrescu wrote:
...

So I was thinking of this:

class LotterySimulation : Lottery, Figure {
    override(Lottery) void draw();
    override(Figure) void draw();
}

This is easy to implement, scales well, and has good real world
uses.
What say you?


Andrei

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.

        Except that the first option could be extended to allow overriding
several methods from the same interface at once:

class LotterySimulation : Lottery, Figure {
    override(Lottery) {
        void draw();
        void foo();
    }
    override(Figure) {
        void draw();
        void foo();
    }
}

                Jerome
--
mailto:[email protected]
http://jeberger.free.fr
Jabber: [email protected]


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to