r4zzz4k
01/19/2018, 2:52 PMclass IntRangeFromZero(val top: Int)
then simple
val rangeTo5 = IntRangeFromZero(5)
for(i in rangeTo5) { ... }
won't work because compiler doesn't know how exactly this class is meant to be iterated over.
So you are providing method which retuns iterator, probably custom one, which is the thing that is able to start somewhere and step through to somewhere else.