Walter - Discrepancy between EqualExpression spec and implementation

Lionello Lunesu lio at lunesu.remove.com
Fri Jun 16 04:42:18 PDT 2006


Walter Bright wrote:
> which means that:
>     a == b == c == d
> is parsed as:
>     (((a == b) == c) == d)
> which I think you'll see matches the grammar. The while loop makes it 
> left-associative.

I think it would be a lot more logical (and useful) if that code were 
interpreted as:

(a==b) && (b==c) && (c==d) //a==b==c==d

Similarly, a < b < c could be the same as

(a < b) && (b < c)  //a<b<c

L.



More information about the Digitalmars-d mailing list