Operators

Arithmetic

OperatorDescriptionExample
+Addition / string concatenation2 + 35, "a" + "b""ab"
-Subtraction / negation5 - 32, -x
*Multiplication4 * 312
/Division10 / 42.5
%Modulo7 % 31

Comparison

OperatorDescription
==Equal
!=Not equal
<Less than
<=Less than or equal
>Greater than
>=Greater than or equal

Comparisons return true or false.

Logical

OperatorDescription
andLogical AND (short-circuit)
orLogical OR (short-circuit)
!Logical NOT
print true and false;     // false
print true or false;      // true
print !true;              // false

Pipe

The pipe operator passes the left-hand value as the first argument to the right-hand function.

value |> func
// equivalent to: func(value)

Pipes chain naturally for multi-step processing:

@blank "Hello"
    |> sepia
    |> blur(3)
    |> border(2)
    => "processed.png";

Compose

The compose operator creates a new function from two existing functions.

var transform = sepia >> blur(3) >> border(2);
@blank "Hello" |> transform => "composed.png";

Save

The fat arrow => saves a meme or GIF to a file.

@blank "Hello" => "hello.png";

See Saving Output for details.

Precedence

From lowest to highest:

PrecedenceOperators
1=> (save)
2|> (pipe)
3>> (compose)
4or
5and
6== !=
7< <= > >=
8+ -
9* / %
10! - (unary)
11. () [] (call, access)