dart-lang / sdk

The Dart SDK, including the VM, dart2js, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
9.97k stars 1.54k forks source link

Change the precedence of bitwise operators #114

Closed DartBot closed 9 years ago

DartBot commented 12 years ago

This issue was originally filed by edsr...@gmail.com


Like JavaScript, Java, and C, Dart places the precedence of the bitwise operators (|, &, and ^) below the equality and relational operators. I'd like to see the bitwise operators bind tighter.

The existing precedence is mostly a historical accident from C. Even Dennis Ritchie (RIP) admitted that it was a mistake in retrospect: https://groups.google.com/d/msg/net.lang.c/tw-N5MiDtZI/wH2TmPLdUTYJ

This change requires fewer parentheses and causes no harm to people expecting the current precedence since these operators don't work on booleans anyway.

floitschG commented 12 years ago

This sounds like a good idea.


Added Area-Language, Triaged labels.

DartBot commented 12 years ago

This comment was originally written by johnle...@google.com


Has this change be finalized? If so, what test case covers it?

iposva-google commented 12 years ago

Set owner to @gbracha. Removed Type-Defect label. Added Type-Enhancement, Accepted labels.

floitschG commented 12 years ago

No test cases yet. If you need test-cases I can write some, but I expected the first implementor (Vm or dartc) to write one.

iposva-google commented 12 years ago

Marked this as blocking #116.

gbracha commented 12 years ago

This change has NOT been finalized. It is a feature request that we are quite sympathetic to, but no change has happened yet. We may want to wait and let things stabilize slightly before making such changes.

DartBot commented 12 years ago

This comment was originally written by johnle...@google.com


Marked this as blocking #117.

iposva-google commented 12 years ago

Unmarked this as blocking #-116.

anders-sandholm commented 12 years ago

Added apr30-triage label.

anders-sandholm commented 12 years ago

Removed apr30-triage label.

anders-sandholm commented 12 years ago

Added triage1 label.

anders-sandholm commented 12 years ago

Makes sense. Pushed to a later milestone.


Added this to the Later milestone. Removed triage1 label.

kasperl commented 11 years ago

Removed this from the Later milestone. Added this to the M3 milestone.

lrhn commented 11 years ago

This change makes less sense if booleans have & and | operators as well. In that case, you would want "foo() == 42 & baz() == 37" to work on the booleans.

gbracha commented 11 years ago

Removed this from the M3 milestone. Added this to the M4 milestone.

gbracha commented 11 years ago

Removed this from the M4 milestone. Added this to the M5 milestone.

lrhn commented 10 years ago

Removed this from the M5 milestone. Added this to the M7 milestone.

gbracha commented 10 years ago

The draft 0.61 spec fixes this.


Added Done label.