Skip to content

Which each?

Projection and Each are more general than Each Right and Each Left. A function can be projected on any of its arguments, and a function can be applied to each item of many lists. Each Right and Each Left apply binary functions only, itemwise right, or itemwise left.

Any expression involving Each Right and Each Left can be transformed into an equivalent expression using only projection and Each. For example:

1 2 3 foo/:10 20 30 40
foo[1 2 3;] each 10 20 30 40

Typically, expressions using Each Right and Each Left are easier to read, and certainly easier to write, than expressions couched in terms of projection and Each. For example

a foo/:\:b

expands to

({foo[x;]each y}[;b]) each a

Prefer Each Right and Each Left to projection and Each.

Back to top