On Thursday, November 29, 2012 01:07:56 Max Samukha wrote: > > It also may be possible to: > > pragma(no_import_dependencies) > > > > or something like that, which also would put the onus on the > > programmer to make sure there really aren't any. > > Pragmas are being superseded by attributes? Maybe a shorter > equivalent of @no_import_dependencies or something? > > Be it pragma or attribute, it would be welcome.
That's understatement. The circular dependency issues with static constructors is _really_ annoying, particularly since they almost never actually represent a circular dependency. Having it check is fine, but there really should be a way to indicate that there is no such dependency. Without it, I don't think that it's even possible to reasonably do stuff like what Andrei is trying to do with std.benchmark without it (it mixes a static constructor into the module that your benchmarking). I don't really care whether it's done with an attribute or a pragma, but pragmas are supposed to be potentially compiler-specific as opposed to being part of the language, so I'd think that an attribute would make more sense. - Jonathan M Davis
