order of static constructor execution

Bob Jones me at not.com
Thu Mar 11 21:27:48 PST 2010


"Walter Bright" <newshound1 at digitalmars.com> wrote in message 
news:hnc9n2$2tkj$1 at digitalmars.com...
> Currently, it is performed as a strictly "depth-first" traversal of the 
> graph defined by the import statements. As we've been discussing here, 
> this works great until one has circular imports, meaning the depth-first 
> graph has a loop in it.
>
> The current behavior on detecting a loop is to quit with an error message.
>
> The problems are:
>
> 1. The cycles are not easily gotten rid of when they are the result of 
> template mixins.
>
> 2. Trying to analyze the static constructors to see what the dependencies 
> actually are is fraught with unsolvable problems.

Surely there must be some low hanging fruit that can be exploited? Say a 
module has no static constructors then cant that be considered a break in 
the dependency cycle?







More information about the Digitalmars-d mailing list