syntax idea: simplifed ifs

Chris Miller chris at dprogramming.com
Tue Apr 11 01:14:49 PDT 2006


On Mon, 10 Apr 2006 18:04:21 -0400, 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)
>
> ciao dennis

The suggestions parse as arrays, which is unfriendly to context-free  
grammar...

static int[] foo = [1 && 2 && 3];
static int[] bar = [ 1, 2, 3 ];
writefln(foo, bar);



More information about the Digitalmars-d mailing list