The range function yields an iterable range over either Integer or Long bounds:
# Prints 1 2 (...) 100
foreach i in range(1, 101) {
print(i + " ")
}
let r = range(0, 6): incrementBy(2)
println("Start: " + r: from())
println("End: " + r: to())
foreach i in r {
println(i)
}
println("Increment: " + r: increment())The lower bound is inclusive, the upper bound is exclusive.