Array enum

Enumerates all elements in ascending index order using an input function with the possibility to interrupt. The elements can be read but cannot be modified using this function.

Arguments

The

array
to enumerate.
body
is the callable to be called for each array entry. It has the following stack notation:

( value -- condition )

Each array entry will be provided as input

value
to the callable. When the output
condition
is FALSE, enumeration interrupts.

Return values

None

Complexity

O(getSize)

Example

"sl/array" useFile a: (1 2 3 5 6 7) makeArray; a [print "," print TRUE] enum
Output:
1,2,3,4,5,6,7,