2

Scala in Actionという本の中で、 Scala REPL 内で:importコマンドを使用すると、次のようになると書かれています。

scala> :imports 
    1) import java.lang._       (153 types, 158 terms)
    2) import scala._           (798 types, 806 terms)
    3) import scala.Predef._    (16 types, 167 terms, 96 are implicit)

この本によると、上記のパッケージはすべて自動的にインポートされます。しかし、私の REPL (Scala 2.10.2) では、1 行しか返されません。

scala> :imports
     1) import scala.Predef._   (162 terms, 78 are implicit)

何か問題がありますか?

4

1 に答える 1

3

「Scala in Action」は 2.9 用に書かれました。

:~$ scala
Welcome to Scala version 2.9.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_25).
Type in expressions to have them evaluated.
Type :help for more information.

scala> :imports
 1) import java.lang._             (193 types, 199 terms)
 2) import scala._                 (798 types, 804 terms)
 3) import scala.Predef._          (16 types, 167 terms, 96 are implicit)
于 2013-09-26T07:18:04.757 に答える