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

Re: Function definition in multiple modules

2012-03-29 Thread simendsjo
On Thu, 29 Mar 2012 12:58:56 +0200, Martin Drasar 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 something like th

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

Re: Function definition in multiple modules

2012-03-29 Thread simendsjo
On Thu, 29 Mar 2012 11:31:57 +0200, Martin Drasar 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 file would implemen

Re: Function definition in multiple modules

2012-03-29 Thread Martin Drasar
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. > > So you code your class normally: > a.d: > class A > { > void a() {} > void b() {} > } > > $ dmd -H a.d > $ cat a.di > // D import file gene

Re: Function definition in multiple modules

2012-03-29 Thread simendsjo
On Thu, 29 Mar 2012 10:33:03 +0200, Martin Drasar 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: class A { void b();