On 10/30/2012 04:47 PM, Philippe Sigaud wrote:
On Tue, Oct 30, 2012 at 3:44 PM, Jacob Carlborg <[email protected]> wrote:
How does that work with operator precedence?
(...)
But because of the operator precedence in Ruby you need to wrap every
comparison in parentheses, not very pretty.
I think the problem would the same here. Of course, to know D operator
precedence, you have to dig into the grammar, since there is no handy
table to give you that info :)
From higher to lower, where relational ops are unordered with respect
to bitwise ops (this is the reason comparisons would have to be wrapped
in parentheses in D as well):
!
=> (not a real operator, occurs twice this is binding power to the left)
. ++ -- ( [
^^ (right-associative)
& ++ -- * - + ! ~ (prefix)
* / %
+ - ~
<< >> >>>
== != > < >= <= !> !< !>= !<= <> !<> <>= !<>= in !in is !is
&
^
|
&&
||
? (right-associative)
/= &= |= -= += <<= >>= >>>= = *= %= ^= ^^= ~= (right-associative)
=> (not a real operator, occurs twice, this is binding power to the right)
,
.. (not a real operator)