Ellery Newcomer wrote:
Hello all,

I began learning D a few months ago, and now I have a question about cyclic dependencies (and some random whining).

I come from a java background and have had no serious exposure to C++. In java, cyclic dependencies are legit to the best of my knowledge. I don't know about C++, thus I don't know about D.

When I first started learning D I decided that a good way to learn it would be by porting a popular java api (mind, I didn't say intelligent), which came complete with a few cyclic dependencies. At the moment, I'm using GDC, and it refuses to swallow cyclic dependencies. The compiler doesn't complain, but it throws a runtime exception. I can break the dependency loops and GDC will work just fine, but what I'm wondering is whether it is standard that the dependency hierarchy be acyclic, or is this some quirk of GDC, or is it more likely that there is something weird going on in my java-to-D translation.

Also, I would be trying to compile with DMD, but I have evidently managed to crash the compiler, and I don't know if it's DMD's fault or mine. It reports an Internal Error in e2ir.c at line 3904. (not being a C++ guru, the line "assert(n2->Enumbytes);" doesn't mean much to me)
That was with DMD 1.037, Tango 0.997, and using dsss to build.

On an unrelated note, is this code supposed to be incorrect?

wchar[] w = (true)? "true":"false";

--> Error: cannot implicitly convert expression ("true") of type char[] to wchar[]

or should it be reported as a bug?

Today I completed a simple code analysis tool for D. There be 91 cyclic dependencies spread among 36 files in my project. Not as bad as I thought it would be.

Reply via email to