Function definition in multiple modules

2012-03-29 Thread Martin Drasar
Hi, I have a class that implements a lot of interfaces and I would like to separate the definition into different files, i.e. implementation of one interface in one file. Something akin to this C++ code: a.cpp: class A { void b(); void c(); }; b.cpp: void A::b() {} c.cpp: void A::c() {}

Re: Function definition in multiple modules

2012-03-29 Thread simendsjo
On Thu, 29 Mar 2012 10:33:03 +0200, Martin Drasar dra...@ics.muni.cz wrote: Hi, I have a class that implements a lot of interfaces and I would like to separate the definition into different files, i.e. implementation of one interface in one file. Something akin to this C++ code: a.cpp:

Re: Function definition in multiple modules

2012-03-29 Thread simendsjo
On Thu, 29 Mar 2012 11:31:57 +0200, Martin Drasar dra...@ics.muni.cz wrote: On 29.3.2012 11:16, simendsjo wrote: D has interface files, .di. These can be automatically generated by the compiler using the -H switch. (snip) I would like to split the X class definition into two files. One

Re: Function definition in multiple modules

2012-03-29 Thread Martin Drasar
On 29.3.2012 12:02, simendsjo wrote: Your looking for partial classes? D doesn't have this as far as I know. alias this should work for more than one value in the future, and then (I think) you should be able to do something like this: class XIB : IB {} class XIA : IA {} class X : IA, IB

Re: Function definition in multiple modules

2012-03-29 Thread simendsjo
On Thu, 29 Mar 2012 12:58:56 +0200, Martin Drasar dra...@ics.muni.cz wrote: On 29.3.2012 12:02, simendsjo wrote: Your looking for partial classes? D doesn't have this as far as I know. alias this should work for more than one value in the future, and then (I think) you should be able to do

Re: Function definition in multiple modules

2012-03-29 Thread Martin Drasar
On 29.3.2012 13:05, simendsjo wrote: It's not string mixins: mixin template XIA() { void a() { ... } // regular function } class X : IA { mixin XIA!() } XIA is injected into X, so X now looks like class X : IA { void a() { ... } } I should have thought and experiment more