"Walter Bright" <[email protected]> wrote in message news:[email protected]... > For discussion: > > Cyclical Imports > > Problem: > > > Proposed Solution: > > Add a pragma, > > pragma(cyclic_imports); > > This can appear anywhere in a module, and applies globally to that module. > It means that static constructors from imports that are not part of the > cycle > are run first, and that the static constructor for this module may be run > before > the static constructors of other modules that are part of the cycle. >
I don't think this is sufficient. Imagine a group of modules that really _do_ have a cyclic dependency, and a mixin that adds an independent static this. Ideally you'd be able to mark the mixed-in constructor as independent without tainting the whole module. So just make the pragma apply to declarations, you either mark specific functions (which can then be mixed in) or put `pragma(...):` at the top of your module and you get your behaviour.
