我正在遵循Scala版本1 30.3(p589)中的编程.在那里它解释了你可以使用'self'作为当前线程的actor来调试repl中的actor.但是,当我跟随Scala 2.9.1时,线程会在接收时挂起.
$ scala -unchecked -deprecation
Welcome to Scala version 2.9.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_26).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import scala.actors.Actor._
import scala.actors.Actor._
scala> self ! "hi"
scala> self.receive { case a => a }
[hangs - should be "res1: Any = hi"]
Run Code Online (Sandbox Code Playgroud)
我检查Scala 2.7.7,它按预期工作.如何使用Scala 2.9.1?
归档时间: |
|
查看次数: |
170 次 |
最近记录: |