Built-in Operators
As operators in Alan are simply aliases for functions with a precedence value associated, all of the following operators have their underlying implementation defined above.
Operator | Infix/Prefix | Precedence | Function |
? | infix | 0 | cond |
== | infix | 1 | eq |
!= | infix | 1 | neq |
< | infix | 1 | lt |
<= | infix | 1 | lte |
> | infix | 1 | gt |
>= | infix | 1 | gte |
~ | infix | 1 | matches |
+ | infix | 2 | concat |
@ | infix | 1 | index |
- | prefix | 1 | negate |
+ | infix | 2 | add |
- | infix | 2 | sub |
* | infix | 3 | mul |
/ | infix | 3 | div |
% | infix | 3 | mod |
** | infix | 4 | pow |
| | infix | 2 | or |
|| | infix | 2 | boolor |
^ | infix | 2 | xor |
!| | infix | 2 | nor |
!^ | infix | 2 | xnor |
|| | infix | 2 | getOr |
* | infix | 3 | repeat |
/ | infix | 3 | split |
% | infix | 3 | template |
& | infix | 3 | and |
&& | infix | 3 | and |
!& | infix | 3 | nand |
! | prefix | 4 | not |
# | prefix | 4 | length |
` | prefix | 4 | trim |
: | infix | 5 | pair |
: | infix | 6 | push |