Skip to content

Instantly share code, notes, and snippets.

@YassineBajdou
Last active August 30, 2018 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YassineBajdou/ea63089f4bf09ab2b039181bdb90b8cd to your computer and use it in GitHub Desktop.
Save YassineBajdou/ea63089f4bf09ab2b039181bdb90b8cd to your computer and use it in GitHub Desktop.
Scala EX01
import scala.actors.Actor
import scala.actors.Actor._
val simpleActor = actor {
loop {
receive {
case s: String => println("This is a string: " + s)
case i: Int => println("This is an integer: " + i.toString)
case _ => println("I don't know what this is.")
}
}
}
simpleActor ! "scala is awesome"
simpleActor ! 32
simpleActor ! 32.134
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment