June 07, 2006
"Walter Bright" <newshound@digitalmars.com> wrote in message news:e6606q$2t33$1@digitaldaemon.com...

> The while loop makes it left-associative.

Right, I noticed that when James replied about it; I looked at the associativity for all the C operators and noticed that only the left-associative operators were implemented this way.


June 16, 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.
1 2
Next ›   Last »