even squares
%+ calls a gate that takes two arguments.
%+(add 2 3) is 5.
irregular forms:
(gate a b) is %+(gate a b)
roll folds a gate across a list into one value, left to right.
(roll `(list @)`~[1 2 3 4] add) is 10.
turn runs a gate over every element of a list, collecting the results - a map.
(turn `(list @)`~[1 2 3] |=(n=@ (mul 2 n))) is ~[2 4 6].
skim keeps the list elements a gate says yes to.
(skim `(list @)`~[1 2 3 4] |=(n=@ (gth n 2))) is ~[3 4].
%: calls a gate with several arguments, gathering them into one sample.
%:(add 2 3) is 5.
irregular forms:
(gate a b c) is %:(gate a b c)
gulf builds an inclusive range of atoms as a list.
(gulf 1 5) is ~[1 2 3 4 5].
|= makes a gate: a function with one named sample, then a body.
the body runs with the sample bound.
call the gate to run it.
(|=(a=@ (add a 1)) 4) is 5.
$= wraps a mold with a face, naming the value it produces.
$=(x @) is the mold x=@.
.= tests two nouns for equality, giving a loobean.
.=(3 3) is %.y, and .=(3 4) is %.n.
irregular forms:
=(a b) is .=(a b)
mod is the remainder of a division.
(mod 17 5) is 2.
mul multiplies two atoms.
(mul 3 4) is 12.
add sums two atoms.
(add 2 3) is 5.