我已经在 Scala 2.7.5 中编写了一个相当大的程序,现在我很期待 2.8 版本.但我很好奇 Scala 演进的这一巨大飞跃将如何影响我.
I've written a rather large program in Scala 2.7.5, and now I'm looking forward to version 2.8. But I'm curious about how this big leap in the evolution of Scala will affect me.
这两个版本的 Scala 之间最大的区别是什么?也许最重要的是:
What will be the biggest differences between these two versions of Scala? And perhaps most importantly:
- 我需要重写什么吗?
- 我是否想要重写任何东西只是为了利用一些很酷的新功能?
- Scala 2.8 有哪些新特性?
- Will I need to rewrite anything?
- Do I want to rewrite anything just to take advantage of some cool new feature?
- What exactly are the new features of Scala 2.8 in general?
您可以在这里找到 Scala2.8 中新功能的预览(2009 年 4 月),最近完成了 这篇文章(2009 年 6 月)
You can find here a preview of new feature in Scala2.8 (April 2009), completed with recent this article (June 2009)
- 命名和默认参数
- 嵌套注释
- 包对象
- @specialized
- 改进的集合(此处可能需要进行一些重写)
- REPL 将具有命令完成功能(更多 关于本文中的这个技巧和其他技巧)
- 新的控制抽象(继续或中断)
- 增强功能(Swing 包装器、表演等)
重写代码"不是义务(除了使用一些改进的集合),而是一些特性,比如 继续(维基百科:一个控制状态的抽象表示,或计算的其余部分"或要执行的代码的其余部分")可以给你一些新的想法.一个很好的介绍是在这里找到,作者是Daniel(他也发布了很多本主题中更详细和具体的答案).
"Rewriting code" is not an obligation (except for using some of the improved Collections), but some features like continuation (Wikipedia: an abstract representation of the control state, or the "rest of computation" or "rest of code to be executed") can give you some new ideas. A good introduction is found here, written by Daniel (who has also posted a much more detailed and specific answer in this thread).
注意:Netbeans 上的 Scala 似乎适用于某些 2.8 nightly-build (vs.2.7.x 的官方页面)
Note: Scala on Netbeans seems to work with some 2.8 nightly-build (vs. the official page for 2.7.x)
更多推荐
Scala 2.8 和 Scala 2.7 之间最大的区别是什么?
发布评论