syntax idea: simplifed ifs
dennis luehring
dl.soluz at gmx.net
Tue Apr 18 07:21:00 PDT 2006
Fredrik Olsson schrieb:
> Hasan Aljudy skrev:
>> dennis luehring wrote:
> <SNIP>
>> I've always wanted something like this!!!! but I think the proposed
>> syntax might not fit very well with the D grammar.
>>
> This problem domain and and then some is easily solved with sets, as I
> have proposed at many occasions in the past :).
>
> As arrays are supersets of sets (Array is an ordered set), my proposals
> works nicely with the array suggestions in this thread as well.
>
> The proposal is to steal the functionality as is from Pascal, no need to
> invent something new, when others already have done it, and put it to
> three decades of testing.
>
> Only some more fancy C/D like syntax is needed.
>
> // Fredrik Olsson
how would you write these example in your in syntax?
if( x == [ a && !b || c ] ) --> if( x == a && x == !b || x == c )
if( x == [ a && (!b || c)] ) --> if( x == a && ( x == !b || x == c ) )
ciao dennis
More information about the Digitalmars-d
mailing list