Fixing cyclic import static construction problems

Walter Bright newshound2 at digitalmars.com
Thu Nov 29 14:43:12 PST 2012


On 11/30/2012 12:09 AM, Daniel Murphy wrote:
> 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.

It is possible for each static constructor to specify independently of 
the other static constructors which imports must be constructed first. 
But do we really want to go that far?



More information about the Digitalmars-d mailing list