Array enumIter

Enumerates all iterators in ascending index order using an input function with the possibility to interrupt. Elements can be read and written using this function.

Arguments

The

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

( iterator -- condition )

An iterator for each array entry will be provided as an input

iterator
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 [it:; it.get 0.0 cast sqrt it.set TRUE] enumIter a [print "," print TRUE] enum
Output:
1.000000,1.414214,1.732051,2.236068,2.449490,2.645751,