Index: libcfa/src/Makefile.am
===================================================================
--- libcfa/src/Makefile.am	(revision a2c2363a574380db06d7194fc74622a5071aae38)
+++ libcfa/src/Makefile.am	(revision e4c3819e836abd40e60fd4abf148f74913f1b85b)
@@ -11,6 +11,6 @@
 ## Created On       : Sun May 31 08:54:01 2015
 ## Last Modified By : Peter A. Buhr
-## Last Modified On : Wed Aug 30 21:22:45 2023
-## Update Count     : 263
+## Last Modified On : Mon Sep 18 17:06:56 2023
+## Update Count     : 264
 ###############################################################################
 
@@ -118,6 +118,5 @@
 	concurrency/mutex_stmt.hfa \
 	concurrency/channel.hfa \
-	concurrency/actor.hfa \
-    concurrency/cofor.hfa
+	concurrency/actor.hfa
 
 inst_thread_headers_src = \
@@ -131,5 +130,6 @@
 	concurrency/mutex.hfa \
 	concurrency/select.hfa \
-	concurrency/thread.hfa
+	concurrency/thread.hfa \
+	concurrency/cofor.hfa
 
 thread_libsrc = ${inst_thread_headers_src} ${inst_thread_headers_src:.hfa=.cfa} \
Index: libcfa/src/concurrency/cofor.cfa
===================================================================
--- libcfa/src/concurrency/cofor.cfa	(revision e4c3819e836abd40e60fd4abf148f74913f1b85b)
+++ libcfa/src/concurrency/cofor.cfa	(revision e4c3819e836abd40e60fd4abf148f74913f1b85b)
@@ -0,0 +1,69 @@
+#include <cofor.hfa>
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// cofor ( uC++ COFOR )
+
+thread co_runner {
+	ssize_t low, high;
+	__cofor_body_t loop_body;
+};
+
+static void ?{}( co_runner & this, ssize_t low, ssize_t high, __cofor_body_t loop_body ) {
+	this.low = low;
+	this.high = high;
+	this.loop_body = loop_body;
+}
+
+void main( co_runner & this ) with( this ) {
+	for ( ssize_t i = low; i < high; i++ )
+		loop_body(i);
+}
+
+void cofor( ssize_t low, ssize_t high, __cofor_body_t loop_body ) libcfa_public {
+	ssize_t range = high - low;
+  if ( range <= 0 ) return;
+	ssize_t nprocs = get_proc_count( *active_cluster() );
+  if ( nprocs == 0 ) return;
+	ssize_t threads = range < nprocs ? range : nprocs;
+	ssize_t stride = range / threads + 1, extras = range % threads;
+	ssize_t i = 0;
+	ssize_t stride_iter = low;
+	co_runner * runners[ threads ];
+	for ( i; threads ) {
+		runners[i] = alloc();
+	}
+	for ( i = 0; i < extras; i += 1, stride_iter += stride ) {
+		(*runners[i]){ stride_iter, stride_iter + stride, loop_body };
+	}
+	stride -= 1;
+	for ( ; i < threads; i += 1, stride_iter += stride ) {
+		(*runners[i]){ stride_iter, stride_iter + stride, loop_body };
+	}
+	for ( i; threads ) {
+		delete( runners[i] );
+	}
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// parallel (COBEGIN/COEND)
+
+thread para_runner {
+	parallel_stmt_t body;
+	void * arg;
+};
+
+static void ?{}( para_runner & this, parallel_stmt_t body, void * arg ) { 
+	this.body = body;
+	this.arg = arg;
+}
+
+void main( para_runner & this ) with( this ) { body( arg ); }
+
+void parallel( parallel_stmt_t * stmts, void ** args, size_t num ) libcfa_public {
+	para_runner * runners[ num ];
+	for ( i; num )
+		(*(runners[i] = malloc())){ stmts[i], args[i] };
+	for ( i; num )
+		delete( runners[i] );
+}
+
Index: libcfa/src/concurrency/cofor.hfa
===================================================================
--- libcfa/src/concurrency/cofor.hfa	(revision a2c2363a574380db06d7194fc74622a5071aae38)
+++ libcfa/src/concurrency/cofor.hfa	(revision e4c3819e836abd40e60fd4abf148f74913f1b85b)
@@ -3,75 +3,19 @@
 //////////////////////////////////////////////////////////////////////////////////////////
 // cofor ( uC++ COFOR )
-typedef void (*cofor_body_t)( long );
-thread co_runner {
-    long lo, hi;
-    cofor_body_t loop_body;
-};
+typedef void (*__cofor_body_t)( ssize_t );
 
-void ?{}( co_runner & this, long lo, long hi, cofor_body_t loop_body ) {
-    this.lo = lo;
-    this.hi = hi;
-    this.loop_body = loop_body;
-}
+void cofor( ssize_t low, ssize_t high, __cofor_body_t loop_body );
 
-void main( co_runner & this ) with( this ) {
-    for ( long i = lo; i < hi; i++ )
-        loop_body(i);
-}
-
-void cofor( long lo, long hi, cofor_body_t loop_body ) {
-    long range = hi - lo;
-    if ( range <= 0 ) return;
-    long nprocs = get_proc_count( *active_cluster() );
-    if ( nprocs == 0 ) return;
-    long threads = range < nprocs ? range : nprocs;
-    long stride = range / threads + 1, extras = range % threads;
-    long i = 0;
-    long stride_iter = lo;
-    co_runner * runners[ threads ];
-    for ( i; threads ) {
-        runners[i] = alloc();
-    }
-    for ( i = 0; i < extras; i += 1, stride_iter += stride ) {
-        (*runners[i]){ stride_iter, stride_iter + stride, loop_body };
-    }
-    stride -= 1;
-    for ( ; i < threads; i += 1, stride_iter += stride ) {
-        (*runners[i]){ stride_iter, stride_iter + stride, loop_body };
-    }
-    for ( i; threads ) {
-        delete( runners[i] );
-    }
-}
-
-#define COFOR( lidname, low, high, body ) \
-    { \
-        void loopBody( long lidname ) { \
-            body \
-        } \
-        cofor( low, high, loopBody ); \
-    }
+#define COFOR( lidname, low, high, loopbody ) \
+	{ \
+		void __CFA_loopLambda__( ssize_t lidname ) { \
+			loopbody \
+		} \
+		cofor( low, high, __CFA_loopLambda__ ); \
+	}
 
 //////////////////////////////////////////////////////////////////////////////////////////
 // parallel (COBEGIN/COEND)
 typedef void (*parallel_stmt_t)( void * );
-thread para_runner {
-    parallel_stmt_t body;
-    void * arg;
-};
 
-void ?{}( para_runner & this, parallel_stmt_t body, void * arg ) { 
-    this.body = body;
-    this.arg = arg;
-}
-
-void main( para_runner & this ) with( this ) { body( arg ); }
-
-void parallel( parallel_stmt_t * stmts, void ** args, size_t num ) {
-    para_runner * runners[ num ];
-    for ( i; num )
-        (*(runners[i] = malloc())){ stmts[i], args[i] };
-    for ( i; num )
-        delete( runners[i] );
-}
-
+void parallel( parallel_stmt_t * stmts, void ** args, size_t num );
Index: sts/concurrency/actors/.expect/matrix.txt
===================================================================
--- tests/concurrency/actors/.expect/matrix.txt	(revision a2c2363a574380db06d7194fc74622a5071aae38)
+++ 	(revision )
@@ -1,4 +1,0 @@
-starting
-started
-stopping
-stopped
Index: tests/concurrency/actors/.expect/matrixMultiply.txt
===================================================================
--- tests/concurrency/actors/.expect/matrixMultiply.txt	(revision e4c3819e836abd40e60fd4abf148f74913f1b85b)
+++ tests/concurrency/actors/.expect/matrixMultiply.txt	(revision e4c3819e836abd40e60fd4abf148f74913f1b85b)
@@ -0,0 +1,4 @@
+starting
+started
+stopping
+stopped
Index: sts/concurrency/actors/matrix.cfa
===================================================================
--- tests/concurrency/actors/matrix.cfa	(revision a2c2363a574380db06d7194fc74622a5071aae38)
+++ 	(revision )
@@ -1,121 +1,0 @@
-#include <actor.hfa>
-#include <fstream.hfa>
-#include <stdlib.hfa>
-#include <string.h>
-#include <stdio.h>
-
-int xr = 500, xc = 500, yc = 500, Processors = 1; // default values, must be signed
-
-struct derived_actor { inline actor; };
-
-struct derived_msg {
-	inline message;
-	int * Z;
-	int * X;
-	int ** Y;
-};
-
-void ?{}( derived_msg & this ) {}
-void ?{}( derived_msg & this, int * Z, int * X, int ** Y ) {
-	set_allocation( this, Nodelete );
-	this.Z = Z;
-	this.X = X;
-	this.Y = Y;
-}
-
-allocation receive( derived_actor & receiver, derived_msg & msg ) {
-	for ( unsigned int i = 0; i < yc; i += 1 ) { // multiply X_row by Y_col and sum products
-		msg.Z[i] = 0;
-		for ( unsigned int j = 0; j < xc; j += 1 ) {
-			msg.Z[i] += msg.X[j] * msg.Y[j][i];
-		} // for
-	} // for
-	return Finished;
-}
-
-int main( int argc, char * argv[] ) {
-	switch ( argc ) {
-	  case 5:
-		if ( strcmp( argv[4], "d" ) != 0 ) {			// default ?
-			Processors = ato( argv[4] );
-			if ( Processors < 1 ) fallthru default;
-		} // if
-	  case 4:
-		if ( strcmp( argv[3], "d" ) != 0 ) {			// default ?
-			xr = ato( argv[3] );
-			if ( xr < 1 ) fallthru default;
-		} // if
-	  case 3:
-		if ( strcmp( argv[2], "d" ) != 0 ) {			// default ?
-			xc = ato( argv[2] );
-			if ( xc < 1 ) fallthru default;
-		} // if
-	  case 2:
-		if ( strcmp( argv[1], "d" ) != 0 ) {			// default ?
-			yc = ato( argv[1] );
-			if ( yc < 1 ) fallthru default;
-		} // if
-	  case 1:											// use defaults
-		break;
-	  default:
-		exit | "Usage: " | argv[0]
-			 | " [ yc (> 0) | 'd' (default " | yc
-			 | ") ] [ xc (> 0) | 'd' (default " | xc
-			 | ") ] [ xr (> 0) | 'd' (default " | xr
-			 | ") ] [ processors (> 0) | 'd' (default " | Processors
-			 | ") ]" ;
-	} // switch
-
-	unsigned int r, c;
-	int * Z[xr], * X[xr], * Y[xc];
-
-	for ( r = 0; r < xr; r += 1 ) {						// create/initialize X matrix
-		X[r] = aalloc( xc );
-		for ( c = 0; c < xc; c += 1 ) {
-			X[r][c] = r * c % 37;						// for timing
-		} // for
-	} // for
-	for ( r = 0; r < xc; r += 1 ) {						// create/initialize Y matrix
-		Y[r] = aalloc( yc );
-		for ( c = 0; c < yc; c += 1 ) {
-			Y[r][c] = r * c % 37;						// for timing
-		} // for
-	} // for
-	for ( r = 0; r < xr; r += 1 ) {						// create Z matrix
-		Z[r] = aalloc( yc );
-	} // for
-
-	executor e{ Processors, Processors, Processors == 1 ? 1 : Processors * 16, true };
-
-	sout | "starting";
-
-	start_actor_system( e );
-
-	sout | "started";
-
-	derived_msg messages[xr];
-
-	derived_actor actors[xr];
-
-	for ( unsigned int r = 0; r < xr; r += 1 ) {
-		messages[r]{ Z[r], X[r], Y };
-	} // for
-
-	for ( unsigned int r = 0; r < xr; r += 1 ) {
-		actors[r] | messages[r];
-	} // for
-
-	sout | "stopping";
-
-	stop_actor_system();
-
-	sout | "stopped";
-
-	for ( r = 0; r < xr; r += 1 ) {						// deallocate X and Z matrices
-		free( X[r] );
-		free( Z[r] );
-	} // for
-	for ( r = 0; r < xc; r += 1 ) {						// deallocate Y matrix
-		free( Y[r] );
-	} // for
-}
Index: tests/concurrency/actors/matrixMultiply.cfa
===================================================================
--- tests/concurrency/actors/matrixMultiply.cfa	(revision e4c3819e836abd40e60fd4abf148f74913f1b85b)
+++ tests/concurrency/actors/matrixMultiply.cfa	(revision e4c3819e836abd40e60fd4abf148f74913f1b85b)
@@ -0,0 +1,121 @@
+#include <actor.hfa>
+#include <fstream.hfa>
+#include <stdlib.hfa>
+#include <string.h>
+#include <stdio.h>
+
+int xr = 500, xc = 500, yc = 500, Processors = 1; // default values, must be signed
+
+struct derived_actor { inline actor; };
+
+struct derived_msg {
+	inline message;
+	int * Z;
+	int * X;
+	int ** Y;
+};
+
+void ?{}( derived_msg & this ) {}
+void ?{}( derived_msg & this, int * Z, int * X, int ** Y ) {
+	set_allocation( this, Nodelete );
+	this.Z = Z;
+	this.X = X;
+	this.Y = Y;
+}
+
+allocation receive( derived_actor & receiver, derived_msg & msg ) {
+	for ( unsigned int i = 0; i < yc; i += 1 ) { // multiply X_row by Y_col and sum products
+		msg.Z[i] = 0;
+		for ( unsigned int j = 0; j < xc; j += 1 ) {
+			msg.Z[i] += msg.X[j] * msg.Y[j][i];
+		} // for
+	} // for
+	return Finished;
+}
+
+int main( int argc, char * argv[] ) {
+	switch ( argc ) {
+	  case 5:
+		if ( strcmp( argv[4], "d" ) != 0 ) {			// default ?
+			Processors = ato( argv[4] );
+			if ( Processors < 1 ) fallthru default;
+		} // if
+	  case 4:
+		if ( strcmp( argv[3], "d" ) != 0 ) {			// default ?
+			xr = ato( argv[3] );
+			if ( xr < 1 ) fallthru default;
+		} // if
+	  case 3:
+		if ( strcmp( argv[2], "d" ) != 0 ) {			// default ?
+			xc = ato( argv[2] );
+			if ( xc < 1 ) fallthru default;
+		} // if
+	  case 2:
+		if ( strcmp( argv[1], "d" ) != 0 ) {			// default ?
+			yc = ato( argv[1] );
+			if ( yc < 1 ) fallthru default;
+		} // if
+	  case 1:											// use defaults
+		break;
+	  default:
+		exit | "Usage: " | argv[0]
+			 | " [ yc (> 0) | 'd' (default " | yc
+			 | ") ] [ xc (> 0) | 'd' (default " | xc
+			 | ") ] [ xr (> 0) | 'd' (default " | xr
+			 | ") ] [ processors (> 0) | 'd' (default " | Processors
+			 | ") ]" ;
+	} // switch
+
+	unsigned int r, c;
+	int * Z[xr], * X[xr], * Y[xc];
+
+	for ( r = 0; r < xr; r += 1 ) {						// create/initialize X matrix
+		X[r] = aalloc( xc );
+		for ( c = 0; c < xc; c += 1 ) {
+			X[r][c] = r * c % 37;						// for timing
+		} // for
+	} // for
+	for ( r = 0; r < xc; r += 1 ) {						// create/initialize Y matrix
+		Y[r] = aalloc( yc );
+		for ( c = 0; c < yc; c += 1 ) {
+			Y[r][c] = r * c % 37;						// for timing
+		} // for
+	} // for
+	for ( r = 0; r < xr; r += 1 ) {						// create Z matrix
+		Z[r] = aalloc( yc );
+	} // for
+
+	executor e{ Processors, Processors, Processors == 1 ? 1 : Processors * 16, true };
+
+	sout | "starting";
+
+	start_actor_system( e );
+
+	sout | "started";
+
+	derived_msg messages[xr];
+
+	derived_actor actors[xr];
+
+	for ( unsigned int r = 0; r < xr; r += 1 ) {
+		messages[r]{ Z[r], X[r], Y };
+	} // for
+
+	for ( unsigned int r = 0; r < xr; r += 1 ) {
+		actors[r] | messages[r];
+	} // for
+
+	sout | "stopping";
+
+	stop_actor_system();
+
+	sout | "stopped";
+
+	for ( r = 0; r < xr; r += 1 ) {						// deallocate X and Z matrices
+		free( X[r] );
+		free( Z[r] );
+	} // for
+	for ( r = 0; r < xc; r += 1 ) {						// deallocate Y matrix
+		free( Y[r] );
+	} // for
+}
