Operators

From Nemerle Homepage

Operators / keywords table sorted by priority from highest to lowest
operator left priority right priority when in context associativity
(x) [x] - - prefix / stand alone -
f(x) y[x] 290 291 postfix left
x.y 285 301 infix left
x++ x-- 283 284 postfix left
+ - ! ~ ++x --x 281 280 prefix right
 : :> 270 246 infix none valid
* / % 260 261 infix left
-> 251 250 infix right
+ - 240 241 infix left
<< >> 230 231 infix left
 :: 221 220 infix right
as 215 301 infix left
< > <= >= is 210 211 infix left
& %& %&& 190 191 infix left
^ %^ 180 181 infix left
¡ %¡ 170 171 infix left
== != 165 166 infix left
&& 160 161 infix left
¡¡ 150 151 infix left
 ?? 146 145 infix right
= *= /= %= += -= <<= >>= &= ^= ¡= 141 140 infix right
when 130 131 infix left

The following operators are implemented as macros in the standard library and therefore cannot be overloaded: &&, ||, %||, %&&, %^^, +=, -=, *=, /=, <<=, >>=, %=, |=, &=, ^=, <->, ::=

Of the above operators the operation-plus-assignment operators can be in effect overloaded by providing a non-assignment version. For instance, providing a "+" operator will also make "+=" work. This is because all the operation-plus-assignment operators expand to "LeftSide = LeftSide <operator> RightSide".

The following operators are implemented as macros but can be overloaded: ++, --

remember
You are very welcome to contribute to the documentation here!