nice library workaround for lack of version boolean operations, would be nice to have in phobos

Timothee Cour thelastmammoth at gmail.com
Wed Jun 5 10:38:47 PDT 2013


On Wed, Jun 5, 2013 at 10:04 AM, Jonathan M Davis <jmdavisProg at gmx.com>wrote:

> On Wednesday, June 05, 2013 02:28:16 Timothee Cour wrote:
> > Just figured out we can do this. Could this be added to phobos?
> [snip]
>
> Walter is flat-out against anything which involves &&ing or ||ing version
> identifiers. It's not like it would be hard to add to the language, but he
> thinks that it's outright bad practice.


DRY and clarity is more important (look at the horrible contorsions one has
to do, eg in the example I provided above). This has been asked for many
times. Once more, it would be great to have a voting system to see if
there's clear majority on either side.



> If we were going to add this, I would
> expect us to just add it to the language, not to the library. So, I'd be
> surprised if anything like this ended up in Phobos.
>


What i described fits more with the rest of the language (and doesn't
require language change).
It allows:

static if( condition && versions.OSX){ ...}
//or:
auto foo = condition && versions.OSX;

(where condition is arbitrary).
A language proposal (eg version(OSX || Windows) ) would not allow it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130605/b231b4e8/attachment.html>


More information about the Digitalmars-d mailing list