7

Why is there no ARM (like Clojure's with-open) provided in the Scala standard library?

Daniel C. Sobral
  • 295,120
  • 86
  • 501
  • 681
unknown
  • 71
  • 1

1 Answers1

11

Short answer

Because nobody's added one yet!

Longer answer

Many proposals for a bigger better I/O library have been put forward, but the best API to use has proved controversial. In particular, the exact way to handle newlines when reading a file line-by-line is a sensitive subject. (e.g. should they be stripped, or passed through as-is? If stripped, should empty lines be skipped over?)

This tends to encourage third-party libraries favouring different needs.

Having said all that... You may want to check out jsuereth's offering on github: https://github.com/jsuereth/scala-arm/wiki

Kevin Wright
  • 49,540
  • 9
  • 105
  • 155
  • 11
    That library is designed to be contributed back to scala's core. Everything in it is 100% compatible with the Scala license and all contributers have signed EPFL's contributor agreement. So it's the best place to contribute if you want to see ARM enter Scala's core library. – jsuereth Nov 03 '10 at 15:57