Integral Type Ranges
suggest changeIntegral ranges (IntRange, LongRange, CharRange) can be iterated. The compiler turns that into the equivalent of a Java indexed for loop, without extra overhead.
for (i in 1..4) print(i) // prints "1234"
for (i in 4..1) print(i) // prints nothing
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents