version()

Manu turkeyman at gmail.com
Sun Jan 15 16:16:03 PST 2012


On 16 January 2012 02:08, Jonathan M Davis <jmdavisProg at gmx.com> wrote:

> On Monday, January 16, 2012 01:44:56 Manu wrote:
> > 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...
>
> People have requested it. Walter is against it. I don't remember his exact
> arguments, but he believes that it leads to worse code if you allow it.
>

Insanity, I argue the exact opposite. My code is WORSE for those 9
completely useless lines. Any sane person would look at that and wonder
WTF... especially someone new to the language.
Imagine my expression was something more complex: version( A || (B && C) )
... the munging code would double in size.



> As for
>
> version(linux || OSX)
>
> you can use
>
> version(Posix)
>
> It'll include FreeBSD as well, but then again, if something is common to
> both
> linux and OSX, then it's almost certainly in FreeBSD as well.


Fair enough, although this is just an example.
In my current case, linux and MinGW are the same, but FreeBSD is different.
You can't rely on predefined unions.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120116/f849db91/attachment.html>


More information about the Digitalmars-d mailing list