version and debug statements

Daniel Keep daniel.keep.lists at gmail.com
Wed May 10 23:23:29 PDT 2006



Anders F Björklund wrote:
> maxter wrote:
> 
>> i've noticed code like this:
>>
>> version (foo)
>> {}
>> else
>> {
>>     do something...
>> }
> 
> Usually written as:
> version (foo) {} else
> {
>      ....
> }
> 

Yeah, I've had to do that a few times myself; very annoying.

>> would it be more natural to be able to write:
>>
>> version (!foo)
>> {
>>     do something...               
>> }
>> the same applies to the debug statement. thanks
> 
> Yes it would, and Thomas patched this in bug #2522
> http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D.bugs/2522
> 
> But I don't think that they ever caught on with W.
> http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/11946
> http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/11995
> 
> --anders

That's odd, given that D is more or less designed to avoid silly hacks
like this...

	-- Daniel

-- 

v1sw5+8Yhw5ln4+5pr6OFma8u6+7Lw4Tm6+7l6+7D
a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP    http://hackerkey.com/



More information about the Digitalmars-d mailing list