Range.untailIter

Returns the range without its last element, and its last iterator. If the tail iterator is deleted, the remaining range becomes invalid.

Arguments

None

Return values

The remaining

range
.
iterator
pointing to the last element of the range.

Complexity

Constant, O(log(size)) for RedBlackTree.

Example

"sl/array" useFile l: (1 2 3 -1 -2 -3 10 20 30 -10 -20 -30) makeArray; r:t: l.makeRange.untailIter;; "-INFINITY" t.set l [print "," print TRUE] enum
Output:
1,2,3,-1,-2,-3,10,20,30,-10,-20,-INFINITY,