63

In this slide show on ScalaActors.pdf what does the single quote indicate when the message is sent to the pong actor?

class Ping(count: int, pong: Pong) extends Actor {
def act() {
   pong ! 'Ping // what does the single quote indicate???
      receive {
         case 'Pong =>
      }
   }
}
Eddie
  • 53,828
  • 22
  • 125
  • 145
JeffV
  • 52,985
  • 32
  • 103
  • 124
  • How is this question closed as the duplicate when it predates the other question by several years? – JeffV May 29 '20 at 18:34

1 Answers1

15

It indicates a Symbol. Eg. cfr http://www.scala-lang.org/docu/files/api/scala/Symbol.html :

the Scala term 'mysym will invoke the constructor of the Symbol class in the following way: Symbol("mysym").

Alex Martelli
  • 854,459
  • 170
  • 1,222
  • 1,395