Beautified actor sequence example.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@13378 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
parent
e5857d7c1c
commit
42307f1582
|
@ -1,23 +1,15 @@
|
|||
package examples.actors
|
||||
|
||||
import scala.actors.Actor._
|
||||
|
||||
object seq extends Application {
|
||||
|
||||
case object A
|
||||
|
||||
import scala.actors.Actor._
|
||||
val a = actor {
|
||||
{
|
||||
react {
|
||||
case A => Console.println("received A")
|
||||
}
|
||||
()
|
||||
} andThen {
|
||||
react {
|
||||
case A => Console.println("received 2nd A")
|
||||
}
|
||||
{ react {
|
||||
case 'A => println("received 1st message")
|
||||
}; ()
|
||||
} andThen react {
|
||||
case 'A => println("received 2nd message")
|
||||
}
|
||||
}
|
||||
a ! A
|
||||
a ! A
|
||||
a ! 'A
|
||||
a ! 'A
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue