Operator summary

Notes

  • If an operator takes arguments of different types then usually the arguments may be given in a different order to the one listed.
  • Most block operations which require an array will implicitly call , (range) when given a number. Exceptions include :, . and f.
Op. Arguments Description Example
! Any ! Boolean “not” 5 !  ->  0
# x:Num y:Num # Power/exponentiation, x^y 2 .5 #  ->  1.4142135623730951
Array Any # Find index, or -1 if not present "banana" "na" #  ->  2
$ Int $ Copy from stack -4 "ab" 3 1$  ->  -4 "ab" 3 "ab"
Array $ Sort [3 0 2 1] $  ->  [0 1 2 3]
% x:Num y:Num % Modulo, x mod y 27 5 %  ->  2
Array Num % Every nth [0 1 2 3 4] 2 %  ->  [0 2 4]
Array Array/Char % Split by "1,2,3" ', %  ->  ["1" "2" "3"]
Array Block % Map [1 2 3] {2*3+} %  ->  [5 7 9]
& Int/Char Int & Bitwise “and” 5 6 &  ->  4
Array Any & Setwise intersection [6 1 8 1] [6 1 1 2] &  ->  [6 1]
( Num/Char ( Decrement 42 (  ->  41
Array ( Uncons from left [2 7 1 8] (  ->  [7 1 8] 2
) Num/Char ) Increment 42 )  ->  43
Array ) Uncons from right [2 7 1 8] )  ->  [2 7 1] 8