Algorithm.reduce

Calculates f(f(f(e1,e2),e3),...en) using values from an enumerable.

Arguments

The

enumerable
provides the arguments to function calls.
The
callable
is a function with the following stack notation:

( inputValue0 inputValue1 -- outputValue )

Return values

value1
is the resulting value.

Complexity

Depends on the enumerable and the callable.

Example

"sl/algorithm" useFile (1 2 3 4 5 6) [*] reduce print LF print (1 2 3 -1 2 3) [ swap 10 * + ] reduce print
Output:
720 122923