Re: Class and Interface Fun

2009-01-25 Thread John Reimer
Hello tim, On Mon, 26 Jan 2009 04:58:57 +1300, John Reimer wrote: Hello tim, On Mon, 26 Jan 2009 01:14:10 +1300, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 25 Jan 2009 15:06:23 +0300, Tim M wrote: On Mon, 26 Jan 2009 00:48:21 +1300, Tim M wrote: On Mon, 26 Jan 2009 00:18:28

Re: Class and Interface Fun

2009-01-25 Thread Tim M
On Mon, 26 Jan 2009 04:58:57 +1300, John Reimer wrote: Hello tim, On Mon, 26 Jan 2009 01:14:10 +1300, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 25 Jan 2009 15:06:23 +0300, Tim M wrote: On Mon, 26 Jan 2009 00:48:21 +1300, Tim M wrote: On Mon, 26 Jan 2009 00:18:28 +1300, Denis

Re: Class and Interface Fun

2009-01-25 Thread Christopher Wright
Denis Koroskin wrote: On Sun, 25 Jan 2009 08:38:18 +0300, Tim M wrote: class B : A,I { void foo() { A.foo(); } } void main() { } It is too verbose and makes twice an overhead. I'd like to avoid this solution. Any reasonable compiler would inline the call to A.foo. In fact, I belie

Re: Class and Interface Fun

2009-01-25 Thread John Reimer
Hello Daniel, [snip] B inherits all the functions from A implicitly. You stil may override any of the I interface functions if need be: class B : A, I { override void foo() { ... } // int bar() is inherited from A } Having B explicitly override all the base class virtual functions and forward

Re: Class and Interface Fun

2009-01-25 Thread John Reimer
Hello tim, It not a bug though. It's all here http://www.digitalmars.com/d/1.0/interface.html and it works like it says. Is there a problem? The only thing that might be close to a bug, I think, is the inability of the "alias" to satisfy the interface contract reimplementation. -JJR

Re: Class and Interface Fun

2009-01-25 Thread John Reimer
Hello tim, On Mon, 26 Jan 2009 01:14:10 +1300, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 25 Jan 2009 15:06:23 +0300, Tim M wrote: On Mon, 26 Jan 2009 00:48:21 +1300, Tim M wrote: On Mon, 26 Jan 2009 00:18:28 +1300, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 25 Jan 2009

Re: Class and Interface Fun

2009-01-25 Thread John Reimer
Hello Daniel, [snip] B inherits all the functions from A implicitly. You stil may override any of the I interface functions if need be: class B : A, I { override void foo() { ... } // int bar() is inherited from A } Having B explicitly override all the base class virtual functions and forward

Re: Class and Interface Fun

2009-01-25 Thread Tim M
It not a bug though. It's all here http://www.digitalmars.com/d/1.0/interface.html and it works like it says. Is there a problem?

Re: Class and Interface Fun

2009-01-25 Thread Daniel Keep
[snip] B inherits all the functions from A implicitly. You stil may override any of the I interface functions if need be: class B : A, I { override void foo() { ... } // int bar() is inherited from A } Having B explicitly overr

Re: Class and Interface Fun

2009-01-25 Thread Denis Koroskin
On Sun, 25 Jan 2009 17:06:50 +0300, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 25 Jan 2009 15:20:19 +0300, Tim M wrote: On Mon, 26 Jan 2009 01:14:10 +1300, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 25 Jan 2009 15:06:23 +0300, Tim M wrote: On Mon, 26 Jan 2009 00:48:21 +13

Re: Class and Interface Fun

2009-01-25 Thread Denis Koroskin
On Sun, 25 Jan 2009 15:20:19 +0300, Tim M wrote: On Mon, 26 Jan 2009 01:14:10 +1300, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 25 Jan 2009 15:06:23 +0300, Tim M wrote: On Mon, 26 Jan 2009 00:48:21 +1300, Tim M wrote: On Mon, 26 Jan 2009 00:18:28 +1300, Denis Koroskin <2kor...

Re: Class and Interface Fun

2009-01-25 Thread Tim M
On Mon, 26 Jan 2009 01:14:10 +1300, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 25 Jan 2009 15:06:23 +0300, Tim M wrote: On Mon, 26 Jan 2009 00:48:21 +1300, Tim M wrote: On Mon, 26 Jan 2009 00:18:28 +1300, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 25 Jan 2009 08:38:18 +

Re: Class and Interface Fun

2009-01-25 Thread Denis Koroskin
On Sun, 25 Jan 2009 15:06:23 +0300, Tim M wrote: On Mon, 26 Jan 2009 00:48:21 +1300, Tim M wrote: On Mon, 26 Jan 2009 00:18:28 +1300, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 25 Jan 2009 08:38:18 +0300, Tim M wrote: On Sun, 25 Jan 2009 17:56:03 +1300, John Reimer wrote:

Re: Class and Interface Fun

2009-01-25 Thread Tim M
On Mon, 26 Jan 2009 00:48:21 +1300, Tim M wrote: On Mon, 26 Jan 2009 00:18:28 +1300, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 25 Jan 2009 08:38:18 +0300, Tim M wrote: On Sun, 25 Jan 2009 17:56:03 +1300, John Reimer wrote: Hello tim, On Sun, 25 Jan 2009 16:43:55 +1300, Joh

Re: Class and Interface Fun

2009-01-25 Thread Tim M
On Mon, 26 Jan 2009 00:18:28 +1300, Denis Koroskin <2kor...@gmail.com> wrote: On Sun, 25 Jan 2009 08:38:18 +0300, Tim M wrote: On Sun, 25 Jan 2009 17:56:03 +1300, John Reimer wrote: Hello tim, On Sun, 25 Jan 2009 16:43:55 +1300, John Reimer wrote: With this code: ---

Re: Class and Interface Fun

2009-01-25 Thread Denis Koroskin
On Sun, 25 Jan 2009 08:38:18 +0300, Tim M wrote: On Sun, 25 Jan 2009 17:56:03 +1300, John Reimer wrote: Hello tim, On Sun, 25 Jan 2009 16:43:55 +1300, John Reimer wrote: With this code: module test5; interface I { void foo(); } class A : I { void f

Re: Class and Interface Fun

2009-01-24 Thread John Reimer
Hello tim, On Sun, 25 Jan 2009 17:56:03 +1300, John Reimer wrote: Hello tim, On Sun, 25 Jan 2009 16:43:55 +1300, John Reimer wrote: With this code: module test5; interface I { void foo(); } class A : I { void foo() { } } class B : A, I { alias A.foo foo;

Re: Class and Interface Fun

2009-01-24 Thread Tim M
On Sun, 25 Jan 2009 17:56:03 +1300, John Reimer wrote: Hello tim, On Sun, 25 Jan 2009 16:43:55 +1300, John Reimer wrote: With this code: module test5; interface I { void foo(); } class A : I { void foo() { } } class B : A, I { alias A.foo foo; } void

Re: Class and Interface Fun

2009-01-24 Thread John Reimer
Hello John, Hello tim, On Sun, 25 Jan 2009 16:43:55 +1300, John Reimer wrote: With this code: module test5; interface I { void foo(); } class A : I { void foo() { } } class B : A, I { alias A.foo foo; } void main() { } I g

Re: Class and Interface Fun

2009-01-24 Thread John Reimer
Hello tim, On Sun, 25 Jan 2009 16:43:55 +1300, John Reimer wrote: With this code: module test5; interface I { void foo(); } class A : I { void foo() { } } class B : A, I { alias A.foo foo; } void main() { } I get this erro

Re: Class and Interface Fun

2009-01-24 Thread Tim M
On Sun, 25 Jan 2009 16:43:55 +1300, John Reimer wrote: With this code: module test5; interface I { void foo(); } class A : I { void foo() { } } class B : A, I { alias A.foo foo; } void main() { } I get th