简体   繁体   中英

:import command inside Scala REPL

It's said in the book Scala in Action that using :import command inside Scala REPL we will see:

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)

And according to this book those packages above are all automatically imported. But in my REPL (Scala 2.10.2) it returns only one line:

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

Is there something wrong?

"Scala in Action" was written for 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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM