digitalmars.D - how to avoid infinite import?
- clayasaurus (15/15) Nov 08 2004 hello, i have two modules, lets say module A and B
- Bastiaan Veelo (3/25) Nov 08 2004 Try it. D is smarter than you think :-)
- clayasaurus (3/33) Nov 08 2004 i have two very big classes that are doing this with global class
- clayasaurus (2/38) Nov 08 2004
- clayasaurus (4/45) Nov 08 2004 ok. well i just found out that it does compile eventually. it just takes...
- John Reimer (3/6) Nov 08 2004 Hmmm... might be similar to the problem DWT is experiencing... except th...
- Bastiaan Veelo (5/7) Nov 08 2004 I don't have D here at the moment, but my project has an import loop and...
- Ant (1/16) Nov 08 2004
hello, i have two modules, lets say module A and B ------------------------ module A; import B; B.func(); ------------------------ ------------------------ module B; import A; A.func(); ------------------------ i'm pretty sure that when i compile it,... it never stops compiling from the infinite import recursion. Both modules need the functions in the other module. How can I avoid this? do i just make it into one module? Thanks.
Nov 08 2004
clayasaurus wrote:hello, i have two modules, lets say module A and B ------------------------ module A; import B; B.func(); ------------------------ ------------------------ module B; import A; A.func(); ------------------------ i'm pretty sure that when i compile it,... it never stops compiling from the infinite import recursion. Both modules need the functions in the other module. How can I avoid this? do i just make it into one module? Thanks.Try it. D is smarter than you think :-) Bastiaan.
Nov 08 2004
i have two very big classes that are doing this with global class variables. I compile it and it never stops. Bastiaan Veelo wrote:clayasaurus wrote:hello, i have two modules, lets say module A and B ------------------------ module A; import B; B.func(); ------------------------ ------------------------ module B; import A; A.func(); ------------------------ i'm pretty sure that when i compile it,... it never stops compiling from the infinite import recursion. Both modules need the functions in the other module. How can I avoid this? do i just make it into one module? Thanks.Try it. D is smarter than you think :-) Bastiaan.
Nov 08 2004
nevermind. it never finishes compiling for some other reason :-/ clayasaurus wrote:i have two very big classes that are doing this with global class variables. I compile it and it never stops. Bastiaan Veelo wrote:clayasaurus wrote:hello, i have two modules, lets say module A and B ------------------------ module A; import B; B.func(); ------------------------ ------------------------ module B; import A; A.func(); ------------------------ i'm pretty sure that when i compile it,... it never stops compiling from the infinite import recursion. Both modules need the functions in the other module. How can I avoid this? do i just make it into one module? Thanks.Try it. D is smarter than you think :-) Bastiaan.
Nov 08 2004
ok. well i just found out that it does compile eventually. it just takes a really long time. it took so long i assumed it was some infinite problem. takes about 10-20 sec to compile a single .d file. clayasaurus wrote:nevermind. it never finishes compiling for some other reason :-/ clayasaurus wrote:i have two very big classes that are doing this with global class variables. I compile it and it never stops. Bastiaan Veelo wrote:clayasaurus wrote:hello, i have two modules, lets say module A and B ------------------------ module A; import B; B.func(); ------------------------ ------------------------ module B; import A; A.func(); ------------------------ i'm pretty sure that when i compile it,... it never stops compiling from the infinite import recursion. Both modules need the functions in the other module. How can I avoid this? do i just make it into one module? Thanks.Try it. D is smarter than you think :-) Bastiaan.
Nov 08 2004
In article <cmo5mn$t5i$1 digitaldaemon.com>, clayasaurus says...ok. well i just found out that it does compile eventually. it just takes a really long time. it took so long i assumed it was some infinite problem. takes about 10-20 sec to compile a single .d file.Hmmm... might be similar to the problem DWT is experiencing... except that the DWT compilation eventually crashes dmd with an "out of memory" error.
Nov 08 2004
clayasaurus wrote:i have two very big classes that are doing this with global class variables. I compile it and it never stops.I don't have D here at the moment, but my project has an import loop and it used to compile. Have not tried the latest releases though. I use private import, but that should not matter much. Bastiaan.
Nov 08 2004
In article <cmo1i9$mi5$1 digitaldaemon.com>, clayasaurus says...hello, i have two modules, lets say module A and B ------------------------ module A; import B; B.func(); ------------------------ ------------------------ module B; import A; A.func(); ------------------------ i'm pretty sure that when i compile it,... it never stops compiling from the infinite import recursion. Both modules need the functions in the other module. How can I avoid this? do i just make it into one module? Thanks.
Nov 08 2004