Class std::Range

Implements Iterable<Int>

Instances of the Range class represent ascending sequences of integer values. A range is defined by two objects, the start (lower bound) and the stop (upper bound). The range includes integers from start up to, but not including, the stop.

class Range
The Range type. Range objects can be constructed using the to operator.

Member constants

start as Int
The lower bound of the range (included in the range).
stop as Int
The upper bound of the range (not included in the range).


iterator() as Iterator<Int>
Return an iterator object that returns all integer values between the lower bound and the upper bound, in ascending order and not including the upper bound.


x to y (Int to IntRange)
Construct a range object representing a range x, x + 1, ..., y - 1. Both x and y must be integers.
for x in range (for Int in Range)
A range can be enumerated in ascending order with a for loop, starting with the lower bound and ending with one less than the upper bound.
range == x (Range == ObjectBoolean)
Range objects can be compared for equality. Two range objects are equal if and only if both their lower and upper bounds are equal.
x in range (Int in RangeBoolean)
Return a boolean indicating whether x >= start and x < stop.
Return a string representation a range.
Return the hash value of a range.