frost.core

Class SteppedRange<EndPoint:Value?, Step:Value>

    └ Value
         └ Immutable
             └ Object

Similar to Range, but with a step value that indicates the number of steps to take during each iteration. For instance, the code:

for i in SteppedRange<Int, Int>(0, 100, 10, true) {
    Console.printLine(i)
}

will count by 10 and print the numbers 0, 10, 20, ..., 90, 100. The exclusive range (..) and inclusive range (...) operators provide a shorthand syntax for creating Range and SteppedRange objects; the loop above could be more succinctly (and readably) written:

for i in 0 ... 100 by 10 {
    Console.printLine(i)
}
Source Code:
View Source

Initializer Summary

init(start:EndPoint, end:EndPoint, step:Step, inclusive:Bit):SteppedRange<EndPoint, Step>
Creates a new SteppedRange.

Field Summary

start:EndPoint
The range's starting point.
end:EndPoint
The range's ending point.
step:Step
The range's step count.
inclusive:Bit
true if the range includes its endpoint.
Inherited Fields:

Initializers

init (start:EndPoint,
 end:EndPoint,
 step:Step,
 inclusive:Bit
):SteppedRange<EndPoint, Step>

Creates a new SteppedRange.

Parameters:
start - value of type EndPoint
end - value of type EndPoint
step - value of type Step
inclusive - value of type Bit

Fields

def start:EndPoint

The range's starting point.

def end:EndPoint

The range's ending point.

def step:Step

The range's step count.

def inclusive:Bit

true if the range includes its endpoint.