!!
recursion
=| acc=@ =/ n 4 |- ?: =(n 0) acc $(acc (add acc (mul n n)), n (dec n))

a loop can do work each step, here squaring before it adds.

glossary

=| pins a name at its type's default value (its bunt) - often an accumulator starting at zero.

=|(n=@ n) is 0.

$= wraps a mold with a face, naming the value it produces.

$=(x @) is the mold x=@.

=/ pins a named value (a face) into the subject for the lines below it.

name=value optionally declares the type.

=/(a 3 (add a a)) is 6.

|- makes a trap and runs it at once.

inside, $ restarts it with new values - this is how you loop.

=/(a 3 |-(?:(=(a 0) 7 $(a (dec a))))) is 7.

?: is if-then-else: it picks its first branch when the test is yes, the second when no.

?:((gth 3 5) 10 20) is 20.

.= tests two nouns for equality, giving a loobean.

.=(3 3) is %.y, and .=(3 4) is %.n.

irregular forms:

=(a b) is .=(a b)

%= resolves a wing with some faces changed.

=/(a [x=1 y=2] a(x 9)) is [x=9 y=2].

irregular forms:

a(x 9) is %=(a x 9)

$(a b) restarts a loop with a changed to b

%: 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)

add sums two atoms.

(add 2 3) is 5.

mul multiplies two atoms.

(mul 3 4) is 12.

dec is decrement: one less than an atom.

(dec 8) is 7.