Is there ANY chance we can fix the bitwise operator precedence rules?

Don nospam at nospam.com
Sat Jun 19 04:58:50 PDT 2010


Andrei Alexandrescu wrote:
> Don wrote:
> [snip]
>> Or is too late to break backwards compatibility with B ?
> 
> We can and should do it. It won't impact TDPL adversely.

Excellent! I'll make a patch for it when I have time.

> 
> A perhaps little known thing is that D doesn't allow this:
> 
> int a, b, c;
> if (a < b < c) { ... }
> 
> although it's compilable code in C. The same strategy could be used for 
> combinations of badly-prioritized operators: the language could just 
> require the user to add parens.
> 
> 
> Andrei


More information about the Digitalmars-d mailing list