version()

Peter Alexander peter.alexander.au at gmail.com
Sun Jan 15 17:14:32 PST 2012


On 16/01/12 12:37 AM, Jonathan M Davis wrote:
> Yes, right now. Everything that isn't Posix may be Windows, but that won't
> necessarily always be true. So, when it comes to versioning, code should
> definitely be versioned on what it _is_ rather than what it _isn't_. But that
> doesn't preclude having&&  and ||. It's just an argument for disallowing !.
> And as you can see by my example, you can essentially _already_ do ! thanks to
> else.

I don't see why having '!' versioning is bad. It's perfectly reasonable 
to have things that happen in every version except one. For example, you 
might not want to run some code if running unittests. For that, using 
version(!unittest) would be ideal.


More information about the Digitalmars-d mailing list