gpt4 book ai didi

scala - :import command inside Scala REPL

转载 作者:行者123 更新时间:2023-12-04 04:40:03 27 4
gpt4 key购买 nike

在 Scala in Action 一书中说使用 :import 在 Scala REPL 中的命令我们将看到:

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) 中它只返回一行:
scala> :imports
1) import scala.Predef._ (162 terms, 78 are implicit)

有什么问题吗?

最佳答案

“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)

关于scala - :import command inside Scala REPL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19021280/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com