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) Source: autoload/Iter.ngs:265
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) Source: autoload/Iter.ngs:248
Initialize RangeIter. Will throw NotImplemented if r.start or r.step are not Int
next(i:RangeIter) Source: autoload/Iter.ngs:256
Return next item in range.