Index: doc/papers/concurrency/examples/Fib2.cfa
===================================================================
--- doc/papers/concurrency/examples/Fib2.cfa	(revision 043a5b6c491eaebba03194f40a1ee7a7962481b3)
+++ doc/papers/concurrency/examples/Fib2.cfa	(revision 043a5b6c491eaebba03194f40a1ee7a7962481b3)
@@ -0,0 +1,45 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2018 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// fibonacci_1.cfa -- 1-state finite-state machine: precomputed first two states returning f(n - 1)
+//
+// Author           : Peter A. Buhr
+// Created On       : Thu Apr 26 23:20:08 2018
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Fri Mar 22 17:26:41 2019
+// Update Count     : 28
+// 
+
+#include <fstream.hfa>
+#include <coroutine.hfa>
+
+coroutine Fibonacci { int fn1; };						// used for communication
+
+void main( Fibonacci & fib ) with( fib ) {				// called on first resume
+	int fn;
+	[fn1, fn] = [0, 1];									// precompute first two states
+	for () {
+		suspend();										// restart last resume
+		[fn1, fn] = [fn, fn1 + fn];						// general case
+	} // for
+}
+
+int ?()( Fibonacci & fib ) with( fib ) {				// function call operator
+	resume( fib );										// restart last suspend
+	return fn1;
+}
+
+int main() {
+	Fibonacci f1, f2;
+	for ( 10 ) {										// print N Fibonacci values
+		sout | f1() | f2();
+	} // for
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa fibonacci_1.cfa" //
+// End: //
Index: doc/papers/concurrency/examples/Pingpong.cfa
===================================================================
--- doc/papers/concurrency/examples/Pingpong.cfa	(revision ae6b6cf796a0f3fdf820aab4c5ad66768ec6d9cb)
+++ doc/papers/concurrency/examples/Pingpong.cfa	(revision 043a5b6c491eaebba03194f40a1ee7a7962481b3)
@@ -4,16 +4,13 @@
 coroutine PingPong {
 	const char * name;
-	/* const */ unsigned int N;
-	PingPong * part;
+	unsigned int N;
+	PingPong & part;
 };
 
 void ?{}( PingPong & this, const char * name, unsigned int N, PingPong & part ) {
-	(this.__cor){name};
-	this.name = name;
-	this.N = N;
-	this.part = &part;
+	this.[name, N] = [name, N];  &this.part = &part;
 }
 void ?{}( PingPong & this, const char * name, unsigned int N ) {
-	this{ name, N, *(PingPong *)0 };
+	this{ name, N, *0p };								// call first constructor
 }
 void cycle( PingPong & pingpong ) {
@@ -21,15 +18,15 @@
 }
 void partner( PingPong & this, PingPong & part ) {
-	this.part = &part;
+	&this.part = &part;
 	resume( this );
 }
-void main( PingPong & pingpong ) {						// ping's starter ::main, pong's starter ping
-	for ( pingpong.N ) {								// N ping-pongs
-		sout | pingpong.name;
-		cycle( *pingpong.part );
+void main( PingPong & pingpong ) with(pingpong) {		// ping's starter ::main, pong's starter ping
+	for ( N ) {											// N ping-pongs
+		sout | name;
+		cycle( part );
 	} // for
 }
 int main() {
-	enum { N = 20 };
+	enum { N = 5 };
 	PingPong ping = { "ping", N }, pong = { "pong", N, ping };
 	partner( ping, pong );
@@ -38,4 +35,4 @@
 // Local Variables: //
 // tab-width: 4 //
-// compile-command: "cfa pingpong.cfa" //
+// compile-command: "cfa Pingpong.cfa" //
 // End: //
Index: doc/papers/concurrency/examples/Pingpong.py
===================================================================
--- doc/papers/concurrency/examples/Pingpong.py	(revision ae6b6cf796a0f3fdf820aab4c5ad66768ec6d9cb)
+++ doc/papers/concurrency/examples/Pingpong.py	(revision 043a5b6c491eaebba03194f40a1ee7a7962481b3)
@@ -1,33 +1,32 @@
-def Scheduler
+def PingPong( name, N ):
+	partner = (yield)           # get partner
+	yield                       # resume scheduler
+	for i in range( N ):
+		print( name )
+		yield partner           # execute next
+	print( "end", name )
+
+def Scheduler():
+	n = (yield)                 # starting coroutine
+	while True:
+		n = next( n )           # schedule coroutine
+
+pi = PingPong( "ping", 5 )
+po = PingPong( "pong", 5 )
+next( pi )                      # prime
+pi.send( po )                   # send partner
+next( po )                      # prime
+po.send( pi )                   # send partner
+
+s = Scheduler();
+next( s )                       # prime
 try:
-	yield from ping();
-	yield from pong();
+	s.send( pi )				# start cycle
 except StopIteration:
-	print( "Scheduler stop" )
-
-
-def pong():
-	print( "pong" )
-for i in range( 10 ):
-
-		yield from ping()
-	print( "stop pong" )
-
-def ping():
-	global i
-	print( "ping" )
-	i += 1
-	if i < 5:
-		yield from pong()
-	print( "stop ping" )
-
-p = ping()
-try:
-	next( p )
-except StopIteration:
-	print( "stop" )
+	print( "scheduler stop" )
+print( "stop" )
 
 # Local Variables: #
 # tab-width: 4 #
-# compile-command: "python3.5 pingpong.py" #
+# compile-command: "python3.5 Pingpong.py" #
 # End: #
Index: doc/papers/concurrency/examples/ProdCons.cfa
===================================================================
--- doc/papers/concurrency/examples/ProdCons.cfa	(revision ae6b6cf796a0f3fdf820aab4c5ad66768ec6d9cb)
+++ doc/papers/concurrency/examples/ProdCons.cfa	(revision 043a5b6c491eaebba03194f40a1ee7a7962481b3)
@@ -23,8 +23,8 @@
 	sout | "prod stops";
 }
-int payment( Prod & prod, int money ) {
-	prod.money = money;
+int payment( Prod & prod, int m ) with(prod) {
+	money = m;
 	resume( prod );										// main 1st time, then
-	return prod.receipt;								// prod in delivery
+	return receipt;										// prod in delivery
 }
 void start( Prod & prod, int N, Cons &c ) {
Index: doc/papers/concurrency/examples/ProdCons.py
===================================================================
--- doc/papers/concurrency/examples/ProdCons.py	(revision 043a5b6c491eaebba03194f40a1ee7a7962481b3)
+++ doc/papers/concurrency/examples/ProdCons.py	(revision 043a5b6c491eaebba03194f40a1ee7a7962481b3)
@@ -0,0 +1,40 @@
+def Prod( N ):
+	cons = (yield)              # get cons
+	yield                       # resume scheduler
+	for i in range( N ):
+		print( "prod" )
+		yield cons              # execute next
+	print( "end", "prod" )
+
+def Cons( N ):
+	prod = (yield)              # get prod
+	yield                       # resume scheduler
+	for i in range( N ):
+		print( "cons" )
+		yield prod              # execute next
+	print( "end", "cons" )
+
+def Scheduler():
+	n = (yield)                 # starting coroutine
+	while True:
+		n = next( n )           # schedule coroutine
+
+prod = Prod( 5 )
+cons = Cons( 5 )
+next( prod )                    # prime
+prod.send( cons )               # send cons
+next( cons )                    # prime
+cons.send( prod )               # send prod
+
+s = Scheduler();
+next( s )                       # prime
+try:
+	s.send( prod )				# start cycle
+except StopIteration:
+	print( "scheduler stop" )
+print( "stop" )
+
+# Local Variables: #
+# tab-width: 4 #
+# compile-command: "python3.5 ProdCons.py" #
+# End: #
