RangeIter type

Iterates over a Range

Example

i = RangeIter(10..20)
echo(i.next())
echo(i.next())
# Output:
#   10
#   11

Direct parent types

Iter
Iterator. Parent type for all specific iterator types.
Direct subtypes: 7
Eachable1
Eachable which each() calls the callback with one argument
Direct subtypes: 16

Methods

Bool(i:RangeIter)
Check whether there is at least one uniterated item in range.

Returns

Bool. true: next() will return next element. false: next() will throw NoNext
init(i:RangeIter, r:NumRange)
Initialize RangeIter. Will throw NotImplemented if r.start or r.step are not Int
next(i:RangeIter)
Return next item in range.