As I’ve mentioned before, I’m part of the technical group looking at updating the ECMA-334 C# standard to reflect the C# 5 Microsoft specification. I recently made a suggestion that I thought would be uncontroversial, but which caused some discussion – and prompted this „request for comment” post, effectively.
What does the standard say about precedence?
The current proposed standard includes the following text:
The order of evaluation of operators in an expression is determined by the precedence and associativity of the operators (§13.4.2).
Operands in an expression are evaluated from left to right.
When an expression contains multiple operators, the precedence of the operators controls the order in which the individual operators are evaluated. [Note: For example, the expression
x + y * zis evaluated as
x + (y * z)because the
*operator has higher precedence than the binary
+operator. end note
View original post 857 słów więcej