为什么Scala stdlib 中没有ARM?

发布于 2024-09-30 03:30:08 字数 60 浏览 0 评论 0原文

为什么Scala标准库中没有提供ARM(如Clojure的with-open)?

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

忆伤 2024-10-07 03:30:08

简短回答

因为还没有人添加!

更长的答案

人们已经提出了许多关于更大更好的 I/O 库的建议,但事实证明最好使用的 API 是有争议的。
特别是,逐行读取文件时处理换行符的确切方法是一个敏感话题。 (例如,它们应该被剥离,还是按原样传递?如果被剥离,是否应该跳过空行?)

这往往会鼓励支持不同需求的第三方库。

说了这么多...您可能想查看 github 上的 jsuereth 产品: https://github .com/jsuereth/scala-arm/wiki

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文