Nicole
05/20/2021, 10:47 AMiterator { produceValue() }
where produceValue is called each time the consumer calls next()
Roukanken
05/20/2021, 10:53 AMgenerateSequence
matches what you want? Or sequence
if it's more complicated
for example generateSequence(0) { it + 1 }
gives you sequence of 0, 1, 2, ...
till you are calling next()
/ iteratingNicole
05/20/2021, 12:55 PMRoukanken
05/20/2021, 1:38 PMsequence
to make iterable from function that suspends execution until next element needs more execution
if you can simply make a function produceNextValue(currentValue)
then generateSequence
is enough for youEyeCon
05/29/2021, 8:04 PM