Created
June 3, 2023 03:20
-
-
Save steshaw/53ea79f8007e7f823a3465f247a737a2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import kotlin.sequences.* | |
fun main() { | |
val i = iterator { | |
for (i in 1..10) { | |
yield(i) | |
} | |
yield(99) | |
} | |
for (a in i) { | |
println(a) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment