25.02.2021 16:17, Hauke Rehr:
Wrong again, the data will be the result of an operation,
the control array will be fixed on many occasions.
Control array to the left, data (whatever shape) to the right.


You can, of course, invent examples when the array for folding
will be filled with control elements,
but in practice it will most likely be data in its pure form.

For example, I need to get subtotals for +/ 1 2 3 4 5
without crazy computational costs for expression if we be using +/\ 1 2 3 4 5.

Fold is suitable for this:
0 ] F:. + 1 2 3 4 5
1 3 6 10 15

> Hauke Rehr:
> and the data argument may well be larger than the array

The same goes for the left argument:
in most cases it will be a single value,
and not an array more complex than an array to fold.

Sergey.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to