On 16 January 2012 09:28, Jacob Carlborg <doob@me.com> wrote:
On 2012-01-16 00:44, Manu wrote:
Why can't I do this:

version( linux || OSX )
{
  something common to each
}

???


This is not acceptable:

version( MinGW )
{
version = linuxOrMinGW;
}
else version( linux )
{
version = linuxOrMinGW;
}

version( linuxOrMinGW )
{
  seriously...?
}


Surely basic logical expressions within a version seem not only logical,
but also very necessary?
There must be a reason this is impossible, or else I can't believe it's
not already like that...

A workaround is to declare variables and use static ifs:

https://github.com/jacob-carlborg/orbit/blob/master/orbit/util/Version.d

... these aren't acceptable work arounds, in this case, you're written a whole module to subvert the insanity! :)
At bare minimum, the version list/map/table/whatever it is should be exposed to static-if, without having to create a module like the one you just described.