Iterate a unary
v1 each x each[v1;x] v1 peach x peach[v1;x]
(vv)each x each[vv;x] (vv)peach x peach[vv;x]
Where
v1 is a unary applicable
valuevv is a variadic applicable valueapplies v1 or vv as a unary to each item of x and returns a result of the same
length.
That is, the projections each[v1;], each[vv;], each[v1;], and
peach[vv;] are uniform functions.
q)count each ("the";"quick";" brown";"fox")
3 5 5 3
q)(+\)peach(2 3 4;(5 6;7 8);9 10 11 12)
2 5 9
(5 6;12 14)
9 19 30 42
each and peach perform the same computation and return the same result.
peach will divide the work between available secondary tasks.
each is a wrapper for the Each iterator.
peach is a wrapper for the Each
Parallel iterator.
It is good q style to use each and peach for unary values.