Why version() ?

grauzone none at example.net
Tue Feb 10 04:34:35 PST 2009


Frits van Bommel wrote:
> grauzone wrote:
>> Some severe disadvantages of version():
>> 1. They can't contain expressions (like "version(linux && mac)").
> 
> Unless Apple has plans to s/BSD/Linux/ in MacOS that I'm not aware of, 
> version(linux || mac) would probably be more useful...
> 
> 
> Allowing boolean expressions (using only version identifiers) in 
> version() would be a very welcome feature.
> 
> I'm not sure about the rest of your post though.

Well, my argument is that CTFE already provides all version features and 
even more. version is redundant, and even dangerous, because it can't 
catch typos in version identifiers.

Actually, C/C++ has something similar: #if (is similar to static if) 
versus #ifdef (is similar to version). ffmpeg recently switched from 
using #ifdef to #if.



More information about the Digitalmars-d mailing list