Acum
is a generic module used for defining storage or accumulation procedure.
![]() | Contrary to the other accumulators, accum has three default inputs and one optional input :
|
" Init " actually defines the accumulator's behaviour.
It must take a function or box on lambda mode, with two inputs :
one for the element to collect,
one for the initial value.
We want to subtract numbers successively – for instance (100-8-2-3-9). For this, we need an initial value, x, a list of numbers, the om- function on "lambda" mode, and acum.
The initial value of acum is 100. Om- is set on "lambda" mode it is connected to the third output of acum. It is applied recursively to the elements of the list and to the initial value. We get (100 - a - b - c - d).
| ![]() |