version and debug statements

Don Clugston dac at nospam.com.au
Thu May 11 02:32:07 PDT 2006


Daniel Keep wrote:
> 
> Anders F Björklund wrote:
>> Daniel Keep wrote:
>>
>>>> version (foo) {} else
>>>> {
>>>>      ....
>>>> }
>>> That's odd, given that D is more or less designed to avoid silly hacks
>>> like this...
>> Both D and W seem to be more open to suggestions now,
>> so maybe it will be added in a future DMD version yet ?
>>
>> I'm still naively hoping for both of "version (Unix)"
>> and "version (!Windows)" to be defined and legal in D.
>>
>> --anders
> 
> Well, I'll continue to hope that at some point it grows boolean
> expressions in version statements like "version(BSD | Linux)", but I can
> live without those :)
> 
> 	-- Daniel

Since "static if" is now legal at module scope, it's now practically a 
superset of "version". So it shouldn't be very complicated to move some 
of the functionality across. (There's a problem with using 'static if' 
instead of 'version' : if there's an 'import' statement bracketed by a 
static if, potentially you have to compile the program to find out which 
files are included. Obviously 'build' can't cope with that).



More information about the Digitalmars-d mailing list