Traits and behavioral reuse in scala.
Scala中的特征和行为重用。
Chapter 5. Basic Object-Oriented Programming in scala.
第5章Scala基础面向对象编程。
The scala interpreter will let you type in both methods.
Scala解释器会让你输入这两个方法。
Running this script with the scala command yields the following output.
用scala命令运行这段脚本会得到以下输出。
Just as scala is a scalable language, Scalatra is a scalable framework.
正如scala是一个可扩展的语言,Scalatra也是一个可扩展的框架。
This allows the scala plugin to provide the scala tools to build the class files.
这就允许Scalaplugin提供Scala工具来构建类文件。
Start the scala interpreter by typing scala and the return key on your command line.
我们可以通过在命令行输入scala,回车,来启动scala解释器。
Whenever we refer to executing a script, we mean running a scala source file with the scala command.
当我们提及执行一个脚本时,就是说用scala命令运行一个scala源文件。
Scala does not allow package declarations in scripts that are executed directly with the scala interpreter.
scala不支持在直接运行于scala解释器中的脚本里加入包的声明。
Experimenting with the scala command in the interactive mode (REPL) is a great way to learn the details of scala.
在交互模式(REPL)模式下来测试scala命令是学习scala细节的一个非常好的方式。
For example, if you installed into /usr/local/scala-2.8.0.final, then add /usr/local/scala-2.8.0.final/bin to your PATH.
例如,如果你安装到 /usr/local/scala-2.8.0.final,那么把/usr/local/scala-2.8.0.final/bin 加入到PATH。
See also the section called “Command Line Tools” in Chapter 14, Scala Tools, Libraries and IDE Support for more information about using the scala command.
也可以参见《第14章 -Scala工具,库和IDE支持》中的“命令行工具”章节来获取更多使用scala 命令的信息。
Listing 2. Hello, Scala servlet!
清单2.Hello,Scalaservlet !
Why doesn't Scala support statics?
Scala为什么不支持statics ?
This is a convenience feature of Scala.
这是Scala中的一个方便的特性。
Return statements are optional in Scala.
返回语句在Scala中是可选的。
Scala version 2.8 drops 1.4 compatibility.
Scala 2.8版本舍弃了1.4 的兼容性。
My first Scala app was a Servlet container.
我的第一个Scala应用是一个Servlet容器。
Let's review the terminology of OOP in Scala.
让我们来回顾一下ScalaOOP的术语。
Clearly the Scala code in Listing 7 is simpler.
显然,清单7中的Scala代码更简单一些。
Scala fully supports Functional Programming (FP).
Scala完全支持函数式编程(FP)。
Remember that object denotes a singleton in Scala.
还记得吗,object表示 Scala中的一个单例。
Download Scala: Start learning it with this series!
下载Scala:跟随本系列学习Scala !
Download Scala: Start learning it with this series.
下载Scala:开始从本系列学习使用Scala。
In fact, Scala eschews the use of "static" altogether.
事实上,Scala完全避开了static的使用。
Scala fully supports Object Oriented Programming (OOP).
Scala完全支持面向对象编程(OOP)。
We had to recompile because we added a new Scala class.
因为我们添加了一个新的scala类,所以必须重新编译。
Along came Scala, which neatly unifies these two worlds.
Scala把这两个世界巧妙地结合了起来。
Scala provides a complete mixin solution, called traits.
Scala提供了完整的混合(mixin)解决方案,称为Traits。
Trying to extend Scala just means creating a new library.
而试图扩展scala则只意味着创建一个新库。
应用推荐