Operators



The following table summarizes all 11l operators in order of precedence from highest to lowest:
x.y
module:f
a[i]
a[%i]
f(x)
x--
x++
x!
x.*
Member access
Module function or variable access
Subscript
N. Subscript ({})
Function call
Postfix decrement
Postfix increment
Non-null assertion operator
Pointer dereference
^Power operator (right to left associative)
-x
+x
!x
~x
--x
++x
&x
Unary minus
Unary plus
Logical NOT
Bitwise NOT
Prefix decrement
Prefix increment
Address-of
x * y
x *& y
x / y
x I/ y
x -I/ y
x % y
x -% y
Multiplication
Overflow multiplication (rationale: {})
Division
Integer division {}
N. Integer division ({})
Remainder
N. Remainder ({}, rationale: {})
x""y and x‘’yString concatenation (rationale)
x + y
x - y
x +& y
x -& y
Addition
Subtraction
Overflow addition
Overflow subtraction
x << y
x >> y
Bitwise left shift
Bitwise right shift
x [&] yBitwise AND (rationale: {})
x (+) yBitwise XOR (rationale: {})
x [|] yBitwise OR (rationale: {})
x < y, x <= y
x > y, x >= y
Comparison operators
x ? yNull coalescing (rationale: {})
x..y, x.<y, x.+len
x<.y, x<.<y
Ranges
x == y, x != y
e in c, e !in c
e C c, e !C c
Comparisons
Including membership tests
x & yLogical AND (rationale: {})
x | yLogical OR
arr1 [+] arr2Array concatenation (rationale: {})
() -> expr
x -> expr
(x, y) -> expr
Lambda expression
x = ...
x += ...
-= *= /= I/=
%= >>= <<= ^=
[+]= [&]= [|]=
(+)= ‘’= .=
Assignments (right to left associative)