Coming from a C/C++ background, I\'m not very familiar with the functional style of programming so all my code tends to be very imperative, as in most cases I just can\'t se
How about this?
val lines = Iterator.continually(reader.readLine()).takeWhile(_ != null).mkString