Index: doc/papers/concurrency/examples/Fib.sim
===================================================================
--- doc/papers/concurrency/examples/Fib.sim	(revision 90b9e4b6a9b073a0248ee68f44eabdfbf4a4295b)
+++ doc/papers/concurrency/examples/Fib.sim	(revision 90b9e4b6a9b073a0248ee68f44eabdfbf4a4295b)
@@ -0,0 +1,47 @@
+BEGIN
+	CLASS Fibonacci;
+		HIDDEN fn, main;					! private members;
+	BEGIN
+		INTEGER fn;							! communication;
+
+		PROCEDURE main;						! mimic uC++ coroutine main;
+		BEGIN
+			INTEGER fn1, fn2;
+
+			fn := 0; fn1 := fn;
+			Detach;							! suspend();
+			fn := 1; fn2 := fn1; fn1 := fn;
+			Detach;							! suspend();
+			WHILE TRUE DO BEGIN
+				fn := fn1 + fn2; fn2 := fn1; fn1 := fn;
+				Detach;						! suspend();
+			END;
+		END;
+
+		INTEGER PROCEDURE next;
+		BEGIN
+			Call( THIS Fibonacci );			! resume();
+			next := fn;
+		END;
+		! Fibonacci constructor code;
+		Detach;								! return to declaration;
+		main;								! call main as last line of constructor;
+	END Fibonacci;
+	! program main equivalent;
+	REF(Fibonacci) f1, f2;					! objects are references;
+	INTEGER i;
+
+	f1 :- NEW Fibonacci;
+	f2 :- NEW Fibonacci;
+	FOR i := 1 STEP 1 UNTIL 10 DO BEGIN
+		OutInt( f1.next, 3 );
+		OutText( " " );
+		OutInt( f2.next, 3 );
+		OutImage;
+	END
+END;
+
+! Local Variables: ;
+! tab-width: 4 ;
+! compile-command: "cim Fib.sim" ;
+! End: ;
Index: doc/papers/concurrency/examples/FibRefactor.py
===================================================================
--- doc/papers/concurrency/examples/FibRefactor.py	(revision 90b9e4b6a9b073a0248ee68f44eabdfbf4a4295b)
+++ doc/papers/concurrency/examples/FibRefactor.py	(revision 90b9e4b6a9b073a0248ee68f44eabdfbf4a4295b)
@@ -0,0 +1,24 @@
+def Fibonacci():
+	def Refactor():
+		nonlocal fn, fn1, fn2
+		fn = 0;	fn1 = fn
+		yield fn						# suspend
+	def Refactor2():
+		nonlocal fn, fn1, fn2
+		fn = 1; fn2 = fn1; fn1 = fn
+		yield fn						# suspend
+
+	yield from Refactor()
+	yield from Refactor2()
+	while True:
+		fn = fn1 + fn2; fn2 = fn1; fn1 = fn; yield fn
+
+f1 = Fibonacci()
+f2 = Fibonacci()
+for i in range( 10 ):
+	print( next( f1 ), next( f2 ) )		# resume
+
+# Local Variables: #
+# tab-width: 4 #
+# compile-command: "python3.5 FibRefactor.py" #
+# End: #
Index: doc/papers/concurrency/examples/Fmt.sim
===================================================================
--- doc/papers/concurrency/examples/Fmt.sim	(revision 90b9e4b6a9b073a0248ee68f44eabdfbf4a4295b)
+++ doc/papers/concurrency/examples/Fmt.sim	(revision 90b9e4b6a9b073a0248ee68f44eabdfbf4a4295b)
@@ -0,0 +1,46 @@
+BEGIN
+	CLASS FmtLines;
+		HIDDEN ch, main;					! private members;
+	BEGIN
+		CHARACTER ch;						! communication;
+
+		PROCEDURE main;						! mimic uC++ coroutine main;
+		BEGIN
+			INTEGER g, b;
+
+			WHILE TRUE DO BEGIN				! for as many characters;
+				FOR g := 1 STEP 1 UNTIL 5 DO BEGIN		! groups of 5;
+					FOR b := 1 STEP 1 UNTIL 4 DO BEGIN	! blocks of 4;
+						OutChar( ch );
+						Detach;				! suspend();
+					END;
+					OutText( "  " );
+				END;
+				OutImage;					! start newline;
+			END;
+		END;
+
+		PROCEDURE prt( chp );
+			CHARACTER chp;
+		BEGIN
+			ch := chp;						! communication;
+			Call( THIS FmtLines );			! resume();
+		END;
+		! FmtLines constructor code;
+		Detach;								! return to declaration;
+		main;								! call main as last line of constructor;
+	END FmtLines;
+	! program main equivalent;
+	REF(FmtLines) fmt;						! objects are references;
+	INTEGER i;
+
+	fmt :- NEW FmtLines;
+	FOR i := Rank( ' ' ) STEP 1 UNTIL Rank( 'z' ) DO BEGIN
+		fmt.prt( Char( i ) );
+	END
+END;
+
+! Local Variables: ;
+! tab-width: 4 ;
+! compile-command: "cim Fmt.sim" ;
+! End: ;
Index: doc/papers/concurrency/examples/Format.cc
===================================================================
--- doc/papers/concurrency/examples/Format.cc	(revision 90b9e4b6a9b073a0248ee68f44eabdfbf4a4295b)
+++ doc/papers/concurrency/examples/Format.cc	(revision 90b9e4b6a9b073a0248ee68f44eabdfbf4a4295b)
@@ -0,0 +1,35 @@
+_Coroutine Format {
+	char ch; // used for communication
+	int g, b; // global because used in destructor
+	void main() {
+		for ( ;; ) { // for as many characters
+			for ( g = 0; g < 5; g += 1 ) { // groups of 5 blocks
+				for ( b = 0; b < 4; b += 1 ) { // blocks of 4 characters
+//					for ( ;; ) { // for newline characters
+						suspend();
+//						if ( ch != '\n' ) break; // ignore newline
+//					}
+//					cout << ch; // print character
+				}
+//				cout << " "; // print block separator
+			}
+//			cout << endl; // print group separator
+		}
+	}
+  public:
+	Format() { resume(); } // start coroutine
+//	~Format() { if ( g != 0 | | b != 0 ) cout << endl; }
+	void prt( char ch ) { Format::ch = ch; resume(); }
+};
+
+int main() {
+	Format fmt;
+	for ( long int i = 0; i < 1000000000; i += 1 )
+		fmt.prt( 'a' );
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// fill-column: 120 //
+// compile-command: "u++-work -O2 -nodebubg Format.cc" //
+// End: //
Index: doc/papers/concurrency/examples/ProdCons.sim
===================================================================
--- doc/papers/concurrency/examples/ProdCons.sim	(revision 90b9e4b6a9b073a0248ee68f44eabdfbf4a4295b)
+++ doc/papers/concurrency/examples/ProdCons.sim	(revision 90b9e4b6a9b073a0248ee68f44eabdfbf4a4295b)
@@ -0,0 +1,104 @@
+BEGIN
+	CLASS Consumer( prod );
+   		REF(Producer) prod; ! constructor parameter;
+		HIDDEN p1, p2, status, done, Main;
+	BEGIN
+		INTEGER p1, p2, status;
+		BOOLEAN done;
+		PROCEDURE main;
+		BEGIN
+			INTEGER money, receipt;
+
+			money := 1;
+			WHILE NOT done DO BEGIN
+				OutText( "cons receives: " );
+				OutInt( p1, 3 );
+				OutText( ", " );
+				OutInt( p2, 3 );
+				status := status + 1;
+				OutText( " and pays $" );
+				OutInt( money, 3 ); OutImage;
+				receipt := prod.payment( money );
+				OutText( "cons receipt #" );
+				OutInt( receipt, 3 ); OutImage;
+				money := money + 1;
+			END;
+			OutText( "cons stops" ); OutImage;
+		END;
+		INTEGER PROCEDURE delivery( p1p, p2p );
+			INTEGER p1p, p2p;
+		BEGIN
+			p1 := p1p;
+			p2 := p2p;
+			Resume( THIS Consumer );
+			delivery := status;
+		END;
+		PROCEDURE stop;
+		BEGIN
+			done := TRUE;
+			Call( THIS Consumer );
+		END;
+		! Consumer constructor code;
+		status := 0;
+		done := FALSE;
+		Detach;
+		main;
+	END Consumer;
+
+	CLASS Producer;
+		HIDDEN cons, N, money, receipt, Main;
+	BEGIN
+		REF(Consumer) cons;
+		INTEGER N, money, receipt;
+		PROCEDURE main;
+		BEGIN
+			INTEGER i, p1, p2, status;
+
+			FOR i := 1 STEP 1 UNTIL N DO BEGIN  
+				p1 := RandInt( 1, 100, p1 );
+				p2 := RandInt( 1, 100, p2 );
+				OutText( "prod delivers: " );
+				OutInt( p1, 3 ); OutText( ", " );
+				OutInt( p2, 3 ); OutImage;
+				status := cons.delivery( p1, p2 );
+				OutText( "prod status: " );
+				OutInt( status, 3 ); OutImage;
+			END;
+			cons.stop;
+			OutText( "prod stops" ); OutImage;
+		END;
+		INTEGER PROCEDURE payment( moneyp );
+			INTEGER moneyp;
+		BEGIN
+			money := moneyp;
+			OutText( "prod payment of $" );
+			OutInt( money, 3 ); OutImage;
+			Resume( THIS Producer );
+			receipt := receipt + 1;
+			payment := receipt;
+		END;
+		PROCEDURE start( Np, consp );
+			INTEGER Np;
+			REF(Consumer) consp;
+		BEGIN
+			N := Np;
+			cons :- consp;
+			Resume( THIS Producer );
+		END;
+		! Producer constructor code;
+		receipt := 0;
+		Detach;
+		main;
+	END Producer;
+	! program main equivalent;
+	REF(Producer) prod;
+	REF(Consumer) cons;
+	prod :- NEW Producer;
+	cons :- NEW Consumer( prod );
+	prod.start( 5, cons );
+END;
+
+! Local Variables: ;
+! tab-width: 4 ;
+! compile-command: "cim ProdCons.sim" ;
+! End: ;
