diff options
author | Hubert Plociniczak <hubert.plociniczak@epfl.ch> | 2011-11-02 14:34:35 +0000 |
---|---|---|
committer | Hubert Plociniczak <hubert.plociniczak@epfl.ch> | 2011-11-02 14:34:35 +0000 |
commit | b6778be91900b8161e705dc2598ef7af86842b0b (patch) | |
tree | d15e8ec18a37eec212f50f1ace27714d7e7d4d34 /docs/examples/actors | |
parent | ac6c76f26d884a94d0c9ff54f055d3f9ab750bac (diff) | |
download | scala-b6778be91900b8161e705dc2598ef7af86842b0b.tar.gz scala-b6778be91900b8161e705dc2598ef7af86842b0b.tar.bz2 scala-b6778be91900b8161e705dc2598ef7af86842b0b.zip |
Begone t1737...
Diffstat (limited to 'docs/examples/actors')
-rw-r--r-- | docs/examples/actors/producers.scala | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/docs/examples/actors/producers.scala b/docs/examples/actors/producers.scala index d3ff903f5b..80e5ae33d3 100644 --- a/docs/examples/actors/producers.scala +++ b/docs/examples/actors/producers.scala @@ -6,13 +6,13 @@ import scala.actors.Actor._ abstract class Producer[T] { /** A signal that the next value should be produced. */ - private val Next = new Object + private val Next = new Object /** A label for an undefined state of the iterators. */ private val Undefined = new Object /** A signal to stop the coordinator. */ - private val Stop = new Object + private val Stop = new Object protected def produce(x: T) { coordinator ! Some(x) @@ -53,10 +53,10 @@ abstract class Producer[T] { } private val producer: Actor = actor { - receive { - case Next => + receive { + case Next => produceValues - coordinator ! None + coordinator ! None } } } @@ -70,7 +70,7 @@ object producers extends Application { def tree = node(node(node(3), 4, node(6)), 8, node(node(9), 10, node(11))) class PreOrder(n: Tree) extends Producer[Int] { - def produceValues = traverse(n) + def produceValues = traverse(n) def traverse(n: Tree) { if (n != null) { produce(n.elem) @@ -81,7 +81,7 @@ object producers extends Application { } class PostOrder(n: Tree) extends Producer[Int] { - def produceValues = traverse(n) + def produceValues = traverse(n) def traverse(n: Tree) { if (n != null) { traverse(n.left) @@ -92,7 +92,7 @@ object producers extends Application { } class InOrder(n: Tree) extends Producer[Int] { - def produceValues = traverse(n) + def produceValues = traverse(n) def traverse(n: Tree) { if (n != null) { traverse(n.left) |