Skip to content
refractalize edited this page Nov 11, 2012 · 4 revisions

Binary Operators

operators precedence associativity
/*% 10 left
-+ 9 left
<<>>>>> 8 left
>>=<<= 7 left
==!= 6 left
& 5 left
^ 4 left
| 3 left
&&@and 2 left
||@or 1 left

Unary Operators

operator
!
@not
~
+
-
--
++

Custom Operators

You can write your own operators, in fact, operators are just function calls. For example:

set1 @union set2

Is the same as:

(set1) union (set2)

And unary operators are similar:

@succ n

Is the same as:

succ (n)

This even works for return, new, throw:

@return @new Date

Or

@throw @new Error 'panic!'
Clone this wiki locally