syntax idea: simplifed ifs

dennis luehring dl.soluz at gmx.net
Mon Apr 10 15:24:14 PDT 2006


Derek Parnell wrote:
> On Tue, 11 Apr 2006 08:04:21 +1000, dennis luehring <dl.soluz at gmx.net>  
> wrote:
> 
>> for example how often do we use constructs like
>>
>> if( x ==  10 && x == 20 && x == 30 )
>>
>> simplified:
>> if( x == [10 && 20 && 30] )
>>
>> if( a >= h && b >= h && c >= h )
>>
>> simplified:
>> if( [a && b && c] >= h )
>>
>> (just an idea)
> 
> 
> A good one too, in my opinion. The || symbol would also be useful.
> 
>   if ( [a || b || c] >= h )

or think of

if( [a || b || c ] >= [ h && b ] )




More information about the Digitalmars-d mailing list