官术网_书友最值得收藏!

Getting started with Scala

If you have already installed Scala, you can skip this paragraph. One can get the latest Scala download from http://www.scala-lang.org/download/. I used Scala version 2.11.7 on Mac OS X El Capitan 10.11.5. You can use any other version you like, but you might face some compatibility problems with other packages such as Spark, a common problem in open source software as the technology adoption usually lags by a few released versions.

Tip

In most cases, you should try to maintain precise match between the recommended versions as difference in versions can lead to obscure errors and a lengthy debugging process.

If you installed Scala correctly, after typing scala, you should see something similar to the following:

[akozlov@Alexanders-MacBook-Pro ~]$ scala
Welcome to Scala version 2.11.7 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_40).
Type in expressions to have them evaluated.
Type :help for more information.

scala>

This is a Scala read-evaluate-print-loop (REPL) prompt. Although Scala programs can be compiled, the content of this chapter will be in REPL, as we are focusing on interactivity with, maybe, a few exceptions. The :help command provides a some utility commands available in REPL (note the colon at the start):

Getting started with Scala
主站蜘蛛池模板: 汉川市| 淮北市| 奉新县| 东明县| 陇南市| 苍溪县| 光泽县| 万荣县| 台中县| 竹溪县| 泽州县| 巴塘县| 萍乡市| 德兴市| 冕宁县| 任丘市| 开化县| 临高县| 新龙县| 大竹县| 宜川县| 察哈| 西青区| 镇巴县| 邹城市| 开封县| 安庆市| 康平县| 大港区| 大田县| 富蕴县| 开化县| 淮阳县| 黄骅市| 裕民县| 辽源市| 清水县| 孝感市| 阜新市| 根河市| 阳春市|