How can I compile this?

Dawid Ciężarkiewicz dawid.ciezarkiewicz at
Sat Oct 14 14:26:26 PDT 2006

Johan Granberg wrote:
> Or you could put all your enums in the same file.
> I don't think that cyclic dependencies is such a good idea even when it
> works, if one finds oneself with that I would merge the  modules
> importing each other together and if the become to big divide the in
> some way that don't create a cycle.

This is sometimes (quite frequent if you use OOP) just impossible.

You got an parent-object, that holds pointers to many children of different
type. And each children have only pointer to it's parent-object to interact
with it, and not to each other.

And modules are for humans, not for compilers. It's programmer who should
benefit from dividing things into logical parts (by his and only his
reasons). I could just put everything in single module ... or event do it
using bash, cat and grep. But this is just ... horrible.

In C++ I don't have to think about what is creates cyclic dep. and what does
not - I can divide everything into pieces as I like. And I never came to
any problems with nesting classes or deps problems. (I just have other
terrible problems that C++ features <g>).

I can't understand why D users can live with such bugs and even say "I don't
think cyclic deps are good idea" (please don't take it personal :) ).
Cyclic deps problems are here for a loooooong time and people seems to be
happy when something that helps only notation - like array literals - or
only templates is added. And for last three months I just feel like
intruder that keep saying "cyclic deps. problem have to be fixed".

While I can live with local notation problems, and without templates making
miracles in compile time, I just can't move on with language that forces me
to screw up my program logic because of something that throws forward
reference errors each time I'm doing anything.

More information about the Digitalmars-d-learn mailing list