diff options
author | Den Shabalin <den.shabalin@gmail.com> | 2013-11-13 15:33:33 +0100 |
---|---|---|
committer | Den Shabalin <den.shabalin@gmail.com> | 2013-11-20 16:06:30 +0100 |
commit | b004c3ddb38f8e690a0895a51ad0c83ff57a01e7 (patch) | |
tree | 0c31f83d2e039db4c2ead7a3280aaabc78671333 /docs/examples/pilib/piNat.scala | |
parent | c243435f113615b2f7407fbd683c93ec16c73749 (diff) | |
download | scala-b004c3ddb38f8e690a0895a51ad0c83ff57a01e7.tar.gz scala-b004c3ddb38f8e690a0895a51ad0c83ff57a01e7.tar.bz2 scala-b004c3ddb38f8e690a0895a51ad0c83ff57a01e7.zip |
deprecate Pair and Triple
Diffstat (limited to 'docs/examples/pilib/piNat.scala')
-rw-r--r-- | docs/examples/pilib/piNat.scala | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/docs/examples/pilib/piNat.scala b/docs/examples/pilib/piNat.scala index a1a0e682e1..c6d9bdaf5c 100644 --- a/docs/examples/pilib/piNat.scala +++ b/docs/examples/pilib/piNat.scala @@ -4,23 +4,23 @@ 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]]] + class NatChan extends Chan[Tuple3[Chan[Unit], Chan[NatChan], Chan[NatChan]]] /** Zero */ def Z(l: NatChan): Unit = choice ( - l * { case Triple(z, sd, d) => z.write(()) } + l * { case (z, sd, d) => z.write(()) } ) /** Successor of Double */ def SD(n: NatChan, l: NatChan): Unit = choice ( - l * { case Triple(z, sd, d) => sd.write(n) } + l * { case (z, sd, d) => sd.write(n) } ) /** Double */ def D(n: NatChan, l: NatChan): Unit = choice ( - l * { case Triple(z, sd, d) => d.write(n) } + l * { case (z, sd, d) => d.write(n) } ) /** Make "l" a location representing the natural "n" */ @@ -34,7 +34,7 @@ object piNat extends Application { val z = new Chan[Unit] val sd = new Chan[NatChan] val d = new Chan[NatChan] - spawn < m.write(Triple(z, sd, d)) >; + spawn < m.write((z, sd, d)) >; choice ( z * { x => make(1, n) }, sd * { m1 => { val n1 = new NatChan; spawn < D(n1, n) >; Succ(m1, n1) } }, @@ -47,7 +47,7 @@ object piNat extends Application { val z = new Chan[Unit] val sd = new Chan[NatChan] val d = new Chan[NatChan] - spawn < l.write(Triple(z, sd, d)) >; + spawn < l.write((z, sd, d)) >; choice ( z * { x => spawn < Z(m) >; Z(n) }, sd * { l1 => { val m1 = new NatChan; val n1 = new NatChan; @@ -64,7 +64,7 @@ object piNat extends Application { val z = new Chan[Unit] val sd = new Chan[NatChan] val d = new Chan[NatChan] - spawn < n.write(Triple(z, sd, d)) >; + spawn < n.write((z, sd, d)) >; choice ( z * { x => 0 }, sd * { n1 => 2 * value(n1) + 1 }, |