Fixing cyclic import static construction problems

Jonathan M Davis jmdavisProg at gmx.com
Thu Nov 29 13:43:18 PST 2012


On Thursday, November 29, 2012 21:08:58 Jacob Carlborg wrote:
> BTW, how does Java handle this? And C# if it has something similar.

They just let you blow your foot off. All static variables can be directly 
initialized at runtime, so it's easy to use variables before they're actually 
initialized. I don't know how they decide what order to run static 
constructors in, but AFAIK, it never worries about circular dependencies. 
We're only running into this problem beacuse we're trying to provide higher 
safety and better guarantees with regards to when and how variables are 
initialized.

- Jonathan M Davis


More information about the Digitalmars-d mailing list