From 42ea1b69568f3bb80c80d302cf609273dcdcc260 Mon Sep 17 00:00:00 2001 From: cremet Date: Wed, 15 Sep 2004 09:29:01 +0000 Subject: - I added an example and a link to the Pilib pa... - I added an example and a link to the Pilib paper in the comments of the library. --- sources/scala/concurrent/pilib.scala | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'sources') diff --git a/sources/scala/concurrent/pilib.scala b/sources/scala/concurrent/pilib.scala index 0bcd19ad45..0562d9646f 100644 --- a/sources/scala/concurrent/pilib.scala +++ b/sources/scala/concurrent/pilib.scala @@ -1,7 +1,19 @@ package scala.concurrent; /** -* Library for using Pi-calculus concurrent primitives in Scala. +* Library for using Pi-calculus concurrent primitives in Scala. As an example, +the definition of a two-place buffer using the pilib library looks like: +*
+*def Buffer[a](put: Chan[a], get: Chan[a]): unit = {
+*  def B0: unit = choice ( put * { x => B1(x) } );
+*  def B1(x: a): unit = choice ( get(x) * B0, put * { y => B2(x, y) } );
+*  def B2(x: a, y: a): unit = choice ( get(x) * B1(y) );
+*  B0
+*}
+*
+* +* @see PiLib: A Hosted Language for Pi-Calculus Style Concurrency +* @author Vincent Cremet, Martin Odersky */ object pilib { -- cgit v1.2.3