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

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Jun 18 14:43:08 PDT 2010


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.

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