On 30/07/12 14:32, Jacob Carlborg wrote:
On 2012-07-30 12:30, torhu wrote:

version is good for global options that you set with -version on the
command line.  And can also be used internally in a module, but doesn't
work across modules.  But it seems you have discovered this the hard way
already.

I think there was a discussion about this a few years ago, Walter did it
this way on purpose.  Can't remember the details, though.

He probably wants to avoid the C macro hell.



IIRC it's because version identifiers are global.

______________________________
module b;
version = CoolStuff;
______________________________

module a;
import b;
version (X86)
{
   version = CoolStuff;
}

version(CoolStuff)
{
   // Looks as though this is only true on X86.
   // But because module b used the same name, it's actually true always.
}
______________________________

These types of problems would be avoided if we used the one-definition rule for version statements, bugzilla 7417.














Reply via email to