Re: private vs protected in Interfaces

2010-08-16 Thread Andrei Alexandrescu
Andrei Alexandrescu wrote: On 08/15/2010 04:01 AM, Ali Çehreli wrote: Jonathan M Davis wrote: It would not be good to be unable to do NVI. I am not saying that it should not be supported; but... I've used NVI a number of times myself until I was convinced by Kevlin Henney that it was "a sol

Re: private vs protected in Interfaces

2010-08-15 Thread Andrei Alexandrescu
On 08/15/2010 04:01 AM, Ali Çehreli wrote: Jonathan M Davis wrote: It would not be good to be unable to do NVI. I am not saying that it should not be supported; but... I've used NVI a number of times myself until I was convinced by Kevlin Henney that it was "a solution in search of a problem

Re: private vs protected in Interfaces

2010-08-15 Thread Ali Çehreli
Jonathan M Davis wrote: It would not be good to be unable to do NVI. I am not saying that it should not be supported; but... I've used NVI a number of times myself until I was convinced by Kevlin Henney that it was "a solution in search of a problem" during one of his many excellent presen

Re: private vs protected in Interfaces

2010-08-14 Thread Andrej Mitrovic
Just for the record, the Classes chapter were a *lot* of fun. Andrei kept the chapters relatively simple, so they're easy to grasp (imo). I thought I was going to spend weeks trying to understand classes in D, but the class features really tie in nicely together. I have yet to reach the operator ov

Re: private vs protected in Interfaces

2010-08-14 Thread Andrej Mitrovic
On page 217+218 there are two interfaces that define some final methods with the same name, and a class that inherits from both: interface Timer { final void run() {} } interface Application { final void run() {} } class TimedApp : Timer, Application { void run() {}// cannot defi

Re: private vs protected in Interfaces

2010-08-14 Thread Andrej Mitrovic
I agree, NVI really looks like a nice idiom/pattern to me, I'd hate to loose it. On Sat, Aug 14, 2010 at 8:20 AM, Jonathan M Davis wrote: > On Friday 13 August 2010 23:14:02 Christian Kamm wrote: > > Andrej Mitrovic wrote: > > > TPDL, page 216: "Making an overridable function private in an > > >

Re: private vs protected in Interfaces

2010-08-14 Thread Andrei Alexandrescu
On 08/14/2010 01:20 AM, Jonathan M Davis wrote: On Friday 13 August 2010 23:14:02 Christian Kamm wrote: Andrej Mitrovic wrote: TPDL, page 216: "Making an overridable function private in an interface..prevents an implementation from calling the super function". But the code example above compil

Re: private vs protected in Interfaces

2010-08-13 Thread Jonathan M Davis
On Friday 13 August 2010 23:14:02 Christian Kamm wrote: > Andrej Mitrovic wrote: > > TPDL, page 216: "Making an overridable function private in an > > interface..prevents an implementation from calling the super function". > > > > But the code example above compiles and runs fine. > > See http://

Re: private vs protected in Interfaces

2010-08-13 Thread Christian Kamm
Andrej Mitrovic wrote: > TPDL, page 216: "Making an overridable function private in an > interface..prevents an implementation from calling the super function". > > But the code example above compiles and runs fine. > See http://d.puremagic.com/issues/show_bug.cgi?id=4542 . By the D spec, priv

private vs protected in Interfaces

2010-08-13 Thread Andrej Mitrovic
More code from TDPL: import std.exception; interface Transmogrifier { final void thereAndBack() {} private: void transmogrify(); void untransmogrify(); } class CardboardBox : Transmogrifier { private: override void transmogrify() { } override void