>>  <<  Ndx  Usr  Pri  JfC  LJ  Phr  Dic  Rel  Voc  !:  wd  Help  Primer

Each

Frequently with boxed data it is useful to be able to do something to the contents of each of the boxes. This is so useful that the standard profile defines an adverb called each that does exactly this. The definition of each involves a little more than you have covered so far, but don't worry about the details, just use it.

The adverb each takes a verb as its left argument. The derived verb is applied to the contents of the boxes of its arguments.
   a =. 10 12 13 ; 2 3 ; 4 5 6 8 3
   a
+--------+---+---------+
10 12 132 34 5 6 8 3
+--------+---+---------+
   +/ each a	NB. sum over each
+--+-+--+
35526
+--+-+--+
   */ each a	NB. times over each
+----+-+----+
156062880
+----+-+----+
   |. each a	NB. reverse each
+--------+---+---------+
13 12 103 23 8 6 5 4
+--------+---+---------+
   >./ each a	NB. max over each
+--+-+-+
1338
+--+-+-+
The previous examples all used the derived verb monadically. The following use the derived verb dyadically.
   23 , each a		NB. append each
+-----------+------+------------+
23 10 12 1323 2 323 4 5 6 8 3
+-----------+------+------------+
   5 < each a
+-----+---+---------+
1 1 10 00 0 1 1 0
+-----+---+---------+
   1 |. each a
+--------+---+---------+
12 13 103 25 6 8 3 4
+--------+---+---------+
Did you catch the new verb |. (reverse or rotate) that slipped in above? Did you look it up in the J Dictionary?

>>  <<  Ndx  Usr  Pri  JfC  LJ  Phr  Dic  Rel  Voc  !:  wd  Help  Primer