What does a single apostrophe mean in Scala?

ScalaActor

Scala Problem Overview


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 =>
      }
   }
}

Scala Solutions


Solution 1 - Scala

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").

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJeffVView Question on Stackoverflow
Solution 1 - ScalaAlex MartelliView Answer on Stackoverflow