Range enumIter

Enumerates all iterators in a range using an input function with the possibility to interrupt.

Arguments

The

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

( iterator -- condition )

An iterator for each entry will be provided as an input

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

Return values

None

Complexity

O(rangeSize), for RedBlackTree can be max(O(rangeSize), O(log(treeSize))).

Example

"sl/linkedList" useFile l: (1 2 10 50) makeList; h:r:t: l.makeRange.unhead.untail;;; r [-3 swap .set TRUE] enumIter l [print "," print TRUE] enum
Output:
1,-3,-3,50,