
학습
for .. in 은 무엇일까
학습하게 된 계기코틀린 코루틴 책을 학습하다가 for문에 Channel class를 사용하는 코드를 보고, list도 아닌 class가 어떻게 원소를 반환하는지 궁금해졌다.suspend fun main(): Unit = coroutineScope { val channel = Channel() launch { repeat(1) { index -> println("Producing next one") delay(1000) channel.send(index * 2) } channel.close() } launch { for (element in channel) { ..