Last active
August 30, 2018 16:43
-
-
Save YassineBajdou/ea63089f4bf09ab2b039181bdb90b8cd to your computer and use it in GitHub Desktop.
Scala EX01
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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