在ScalaActors.pdf上的这个幻灯片放映中,单个引号指示何时将消息发送给pong actor?
class Ping(count: int, pong: Pong) extends Actor {
def act() {
pong ! 'Ping // what does the single quote indicate???
receive {
case 'Pong =>
}
}
}
Run Code Online (Sandbox Code Playgroud)
Ale*_*lli 13
它表示符号.例如.cfr http://www.scala-lang.org/docu/files/api/scala/Symbol.html:
Scala术语'mysym将以下列方式调用Symbol类的构造函数:Symbol("mysym").
| 归档时间: |
|
| 查看次数: |
12970 次 |
| 最近记录: |