digitalmars.D.learn - Split class declaration and definition
- Kozzi11 (17/17) Jul 31 2014 Is possible to somehow split class declaration and definition.
- FreeSlave (3/20) Jul 31 2014 dmd -c -o- -H yourmodule.d
- Kozzi11 (14/38) Jul 31 2014 I know that, but this is not exactly what I mean. I mean
- Kagamin (6/16) Jul 31 2014 This is usually done by generating functions in the classes
- Daniel Kozak via Digitalmars-d-learn (4/24) Jul 31 2014 V Thu, 31 Jul 2014 13:26:38 +0000
- bearophile (5/22) Jul 31 2014 I think this is currently not possible. (And I don't like it in
Is possible to somehow split class declaration and definition. I mean something like this: class C { void hello(); // just prototype } class C { void hello() { //actual code } } or something like this void C.hello() { //actual code }
Jul 31 2014
On Thursday, 31 July 2014 at 11:34:38 UTC, Kozzi11 wrote:Is possible to somehow split class declaration and definition. I mean something like this: class C { void hello(); // just prototype } class C { void hello() { //actual code } } or something like this void C.hello() { //actual code }dmd -c -o- -H yourmodule.d will create .di file (i.e. interface)
Jul 31 2014
On Thursday, 31 July 2014 at 11:41:07 UTC, FreeSlave wrote:On Thursday, 31 July 2014 at 11:34:38 UTC, Kozzi11 wrote:I know that, but this is not exactly what I mean. I mean something like this: http://wiki.dlang.org/DIP47 . I will have something like: module m; someUda class C { void someFun(); } someUda class D { void anotherFun(); } mixin(generateFunDefForClassesWithSomeUda!m);Is possible to somehow split class declaration and definition. I mean something like this: class C { void hello(); // just prototype } class C { void hello() { //actual code } } or something like this void C.hello() { //actual code }dmd -c -o- -H yourmodule.d will create .di file (i.e. interface)
Jul 31 2014
On Thursday, 31 July 2014 at 12:02:22 UTC, Kozzi11 wrote:module m; someUda class C { void someFun(); } someUda class D { void anotherFun(); } mixin(generateFunDefForClassesWithSomeUda!m);This is usually done by generating functions in the classes directly. class C { mixin Generate!"C"; }
Jul 31 2014
V Thu, 31 Jul 2014 13:26:38 +0000 Kagamin via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> napsáno:On Thursday, 31 July 2014 at 12:02:22 UTC, Kozzi11 wrote:Yes this is how I do it now.module m; someUda class C { void someFun(); } someUda class D { void anotherFun(); } mixin(generateFunDefForClassesWithSomeUda!m);This is usually done by generating functions in the classes directly. class C { mixin Generate!"C"; }
Jul 31 2014
Kozzi11:Is possible to somehow split class declaration and definition. I mean something like this: class C { void hello(); // just prototype } class C { void hello() { //actual code } } or something like this void C.hello() { //actual code }I think this is currently not possible. (And I don't like it in D). Bye, bearophile
Jul 31 2014