这是我从书中使用的代码...
import scala.actors.Actor._
val countActor = actor {
loop {
react {
case "how many?" => {
println("I've got " + mailboxSize.toString + " messages in my mailbox.")
}
}
}
}
countActor ! 1
countActor ! 2
countActor ! 3
countActor ! "how many?"
countActor ! "how many?"
countActor ! 4
countActor ! "how many?"
错误
java.lang.NoClassDefFoundError: Main$$anon$1$$anonfun$1$$anonfun$apply$2