0
我正在跟隨編程在斯卡拉版1 30.3(p589)。在那裏它解釋了你可以使用'self'作爲當前線程的actor來調試repl中的actor。但是,當我跟隨Scala 2.9.1時,線程掛起接收。自我演員掛在repl
$ 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"]
我檢查與Scala 2.7.7,它按預期工作。我如何才能使用Scala 2.9.1?
謝謝!將發送和接收放在一條輸入線上工作(無論它們是否在一個塊中)。雖然REPL選項非常好。 –