Accepting Input in a Scala Worksheet

Is it possible to accept user input in a Scala Worksheet? For example:

println("Enter some numbers and press Ctrl-D")

val input = Source.fromInputStream(
val lines = input.getLines().collect

println("Sum "+sum(lines))

I can type a few lines and press Ctrl-D, and have IntelliJ continue interpreting the worksheet.
1 comment
Comment actions Permalink

Not, it's not possible for now. Not sure it can be useful. However we will think about it too, when we will rework worksheet feature.

Best regards,
Alexander Podkhalyuzin.


Please sign in to leave a comment.