System.Creep - Manhunter07/MFL GitHub Wiki
Declaration
function Creep(Values: array, Length: System.PosInt, Creeper: function): array = \built-in\
Description
The Creep
function in the System
package maps slices of an array to a new array.
The second parameter (Length
) represents the length of each slice. The third parameter is a function with the amount of parameters equal to Length
. When the function is called, System.Length(Values) - Length + 1
iterations are done through the array and the elements at relative positions 0
to Length - 1
are passed as arguments to Creeper
. The creeper function shall return an array that is concatenated to to function result.
Remarks
- If the length of
Values
is zero or less than the value ofLength
,Creeper
is never called and an empty array ([]
) is returned. - If
Creeper
demands more or less arguments thanLength
, an exception is raised.