https://kotlinlang.org logo
Title
e

Ellen Spertus

01/05/2021, 1:00 AM
I ran the following code in the IntelliJ REPL and was surprised that the output was a single line, not three.
for (num in listOf(1, 2, 3)) println(num)
123
Why isn't each element on its own line?
n

nanodeath

01/05/2021, 1:02 AM
huh. must be a REPL thing
✔️ 1
v

Vampire

01/05/2021, 1:09 AM
Woah, that's unexpected. Maybe a bug even
It's not a REPL think, it's a REPL in IntelliJ thing. The commandline REPL does not behave like that according to OP.
n

nanodeath

01/05/2021, 1:14 AM
that last example is what really baffles me
v

Vampire

01/05/2021, 1:14 AM
Why?
n

nanodeath

01/05/2021, 1:15 AM
that's really just emitting two "\n" chars, isn't it?
v

Vampire

01/05/2021, 1:15 AM
yes