removal of cruft from D

Walter Bright newshound1 at digitalmars.com
Wed Nov 25 02:05:45 PST 2009


Bill Baxter wrote:
>> version(int) is like a programming language with one variable. It's
>> ridiculous.
> 
> One variable, and one operator, >=.
> 
> To be fair, it was clearly intended to refer to the version of the
> final user's app, not a library version or platform version or
> anything else.
> 
> But to assume that only apps have versions, and that >= is the only
> test you'd ever want to perform is, I agree, pretty silly.

The way to use it would be:

version (2)
{
     version = HasFeatureX;
     version = HasFeatureY;
     version = HasFeatureZ;
}

...

version (HasFeatureY)
{
     ...
}



More information about the Digitalmars-d mailing list