version and debug statements

Ameer Armaly ameer_armaly at hotmail.com
Thu May 11 05:11:42 PDT 2006


"Daniel Keep" <daniel.keep.lists at gmail.com> wrote in message 
news:e3ul8t$ag8$2 at digitaldaemon.com...
>
>
> 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...
I agree.  Having to define an empty version block is most definitely 
inefficient and doesn't support code readability.
>
> -- Daniel
>
> -- 
>
> v1sw5+8Yhw5ln4+5pr6OFma8u6+7Lw4Tm6+7l6+7D
> a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP    http://hackerkey.com/ 





More information about the Digitalmars-d mailing list