-
Notifications
You must be signed in to change notification settings - Fork 9
Operators
Andrew edited this page Mar 17, 2015
·
3 revisions
The following operators exist in LENS, sorted ascending by priority:
Priority | Operators | Description |
0 | & | Bitwise AND |
| | Bitwise OR | |
^ | Bitwise XOR | |
1 | && | Boolean AND |
|| | Boolean OR | |
^^ | Boolean XOR | |
not | Unary boolean negation | |
2 | == | Equal |
<> | Not Equal | |
< | Less | |
<= | Less or equal | |
> | Greater | |
>= | Greater or equal | |
3 | <: | Shift left |
:> | Shift right / function composition | |
4 | + | Addition / concatenation |
- | Subtraction | |
- | Unary negation | |
5 | * | Multiplication / repetition |
/ | Division | |
% | Division remainder | |
6 | ** | Raise to power |
- Custom overloaded operators are supported.
-
&&
and||
operators are short-circuit. This means that the rightside expression may not be executed if the result can be determined by the value of the leftside expression. This feature is useful, but should be used with caution. - The
:>
operator can be used to compose functions.