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/pilib | |
parent | ac6c76f26d884a94d0c9ff54f055d3f9ab750bac (diff) | |
download | scala-b6778be91900b8161e705dc2598ef7af86842b0b.tar.gz scala-b6778be91900b8161e705dc2598ef7af86842b0b.tar.bz2 scala-b6778be91900b8161e705dc2598ef7af86842b0b.zip |
Begone t1737...
Diffstat (limited to 'docs/examples/pilib')
-rw-r--r-- | docs/examples/pilib/elasticBuffer.scala | 2 | ||||
-rw-r--r-- | docs/examples/pilib/handover.scala | 6 | ||||
-rw-r--r-- | docs/examples/pilib/mobilePhoneProtocol.scala | 10 | ||||
-rw-r--r-- | docs/examples/pilib/piNat.scala | 2 | ||||
-rw-r--r-- | docs/examples/pilib/rwlock.scala | 4 | ||||
-rw-r--r-- | docs/examples/pilib/scheduler.scala | 2 | ||||
-rw-r--r-- | docs/examples/pilib/semaphore.scala | 2 | ||||
-rw-r--r-- | docs/examples/pilib/twoPlaceBuffer.scala | 2 |
8 files changed, 15 insertions, 15 deletions
diff --git a/docs/examples/pilib/elasticBuffer.scala b/docs/examples/pilib/elasticBuffer.scala index a0e8bb6a7c..5fec96ab6c 100644 --- a/docs/examples/pilib/elasticBuffer.scala +++ b/docs/examples/pilib/elasticBuffer.scala @@ -25,7 +25,7 @@ object elasticBuffer { /** * A buffer cell containing a value, ready to receive (o,r) from the right. */ - def Cl(i: Chan[String], l: MetaChan, + def Cl(i: Chan[String], l: MetaChan, o: Chan[String], r: MetaChan, content: String): Unit = choice ( o(content) * (Bl(i,l,o,r)), diff --git a/docs/examples/pilib/handover.scala b/docs/examples/pilib/handover.scala index 9725382c96..c9b6156c2c 100644 --- a/docs/examples/pilib/handover.scala +++ b/docs/examples/pilib/handover.scala @@ -32,7 +32,7 @@ object handoverRecursive { * Control center. */ def Control(talk1: Chan[unit], switch1: Switch, - gain1: Switch, lose1: Switch, + gain1: Switch, lose1: Switch, talk2: Chan[unit], switch2: Switch, gain2: Switch, lose2: Switch): unit = { @@ -108,7 +108,7 @@ object handoverCast { def Car(talk: Chan[Any], switch: Chan[Any]): unit = choice ( switch * (o => { - val Pair(t,s) = o.asInstanceOf[Pair[Chan[Any],Chan[Any]]]; + val Pair(t,s) = o.asInstanceOf[Pair[Chan[Any],Chan[Any]]]; Car(t, s) }), talk(()) * ( { @@ -122,7 +122,7 @@ object handoverCast { * Control center. */ def Control(talk1: Chan[Any], switch1: Chan[Any], - gain1: Chan[Any], lose1: Chan[Any], + gain1: Chan[Any], lose1: Chan[Any], talk2: Chan[Any], switch2: Chan[Any], gain2: Chan[Any], lose2: Chan[Any]): unit = { diff --git a/docs/examples/pilib/mobilePhoneProtocol.scala b/docs/examples/pilib/mobilePhoneProtocol.scala index 0805253ae0..e8c0ac1dc4 100644 --- a/docs/examples/pilib/mobilePhoneProtocol.scala +++ b/docs/examples/pilib/mobilePhoneProtocol.scala @@ -21,7 +21,7 @@ object mobilePhoneProtocol { case class HoCom() extends Message; // handover complete case class HoFail() extends Message; // handover fail case class ChRel() extends Message; // release - case class Voice(s: String) extends Message; // voice + case class Voice(s: String) extends Message; // voice case class Channel(n: Chan[Message]) extends Message; // channel def MobileSystem(in: Chan[String], out: Chan[String]): unit = { @@ -144,9 +144,9 @@ object mobilePhoneProtocol { } //***************** Entry function ******************// - + def main(args: Array[String]): unit = { - + def Producer(n: Int, put: Chan[String]): unit = { Thread.sleep(1 + random.nextInt(1000)); val msg = "object " + n; @@ -154,14 +154,14 @@ object mobilePhoneProtocol { System.out.println("Producer gave " + msg); Producer(n + 1, put) } - + def Consumer(get: Chan[String]): unit = { Thread.sleep(1 + random.nextInt(1000)); val msg = get.read; System.out.println("Consumer took " + msg); Consumer(get) } - + val put = new Chan[String]; val get = new Chan[String]; spawn < Producer(0, put) | Consumer(get) | MobileSystem(put, get) > diff --git a/docs/examples/pilib/piNat.scala b/docs/examples/pilib/piNat.scala index ee9e5ba1af..a1a0e682e1 100644 --- a/docs/examples/pilib/piNat.scala +++ b/docs/examples/pilib/piNat.scala @@ -4,7 +4,7 @@ import scala.concurrent.pilib._ /** Church encoding of naturals in the Pi-calculus */ object piNat extends Application { - + /** Locations of Pi-calculus natural */ class NatChan extends Chan[Triple[Chan[Unit], Chan[NatChan], Chan[NatChan]]] diff --git a/docs/examples/pilib/rwlock.scala b/docs/examples/pilib/rwlock.scala index 931f622f5a..bb1c26bdf2 100644 --- a/docs/examples/pilib/rwlock.scala +++ b/docs/examples/pilib/rwlock.scala @@ -250,7 +250,7 @@ object rwlock { def endRead = er.send def endWrite = ew.send - private def Reading(nr: int, nw: int): unit = + private def Reading(nr: int, nw: int): unit = if (nr == 0 && nw == 0) choice ( sr * (x => Reading(1, 0)), @@ -264,7 +264,7 @@ object rwlock { choice ( sr * (x => Reading(nr + 1, 0)), er * (x => Reading(nr - 1, 0)), - ww * (x => Reading(nr, 1)) + ww * (x => Reading(nr, 1)) ) else if (nr != 0 && nw != 0) choice ( diff --git a/docs/examples/pilib/scheduler.scala b/docs/examples/pilib/scheduler.scala index 9205ae3f0c..fd8fd52600 100644 --- a/docs/examples/pilib/scheduler.scala +++ b/docs/examples/pilib/scheduler.scala @@ -87,7 +87,7 @@ object scheduler { /** * A cell is modelled as a function that takes as parameters - * input and output channels and which returns nothing. + * input and output channels and which returns nothing. */ type Cell = (Chan[Unit], Chan[Unit]) => Unit diff --git a/docs/examples/pilib/semaphore.scala b/docs/examples/pilib/semaphore.scala index ed224890e2..951c90e8d4 100644 --- a/docs/examples/pilib/semaphore.scala +++ b/docs/examples/pilib/semaphore.scala @@ -65,7 +65,7 @@ object semaphore { println("b1"); Thread.sleep(1 + random.nextInt(100)); println("b2") - } ) + } ) } >; } } diff --git a/docs/examples/pilib/twoPlaceBuffer.scala b/docs/examples/pilib/twoPlaceBuffer.scala index f0f278317a..255f70ca06 100644 --- a/docs/examples/pilib/twoPlaceBuffer.scala +++ b/docs/examples/pilib/twoPlaceBuffer.scala @@ -16,7 +16,7 @@ object twoPlaceBuffer extends Application { def B1(x: A): Unit = choice ( out(x) * (B0), - in * (y => B2(x, y)) + in * (y => B2(x, y)) ) def B2(x: A, y: A): Unit = choice ( |