Without (the class implemeting Iterable): ``` clas...
# getting-started
k
Without (the class implemeting Iterable):
Copy code
class Foo() {
    operator fun next() = 1
    operator fun hasNext() = true
}

for (i in MyObj()) { println(i) }
Will print
1
forever.