When running the following code as a snippet from https://www.programiz.com/kotlin-programming/examples/convert-list-array :
// printing elements of the array list
vowels_list.forEach { System.out.print(it) }
// vowels array
val vowels_array: Array<String> = arrayOf("a", "e", "i", "o", "u")
// converting array to array list
val vowels_list: List<String> = vowels_array.toList()
// printing elements of the array list
vowels_list.forEach { System.out.print(it) }
The output is supposed to be aeiou
However when I am running it in the kotlin
REPL nothing is printed. Why is that?
Update There seems to be something going on for the kotlin repl
itself. I just noticed there is a bracket - as if the code were not completed yet:
I have to hit CTL-C
and then we see this:
aeiou<interrupted>
What is happening here?