Index: doc/theses/mike_brooks_MMath/programs/hello-accordion.cfa
===================================================================
--- doc/theses/mike_brooks_MMath/programs/hello-accordion.cfa	(revision 57174958a53dde3bf79d4a2b102573e186836bdd)
+++ doc/theses/mike_brooks_MMath/programs/hello-accordion.cfa	(revision 40ab446132dfae80816ea4fe1e9a484846b04f8e)
@@ -1,4 +1,28 @@
-#include "stdlib.hfa"
-#include "array.hfa"
+#include <fstream.hfa>
+#include <stdlib.hfa>
+#include <array.hfa>
+
+
+
+
+
+
+
+forall( T, [Nclients], [Ncosts] )
+struct request {
+    unsigned int requestor_id;
+    array( T, Nclients ) impacted_client_ids; // nested VLA
+    array( float, Ncosts ) cost_contribs; // nested VLA
+    float total_cost;
+};
+
+
+// TODO: understand (fix?) why these are needed (autogen seems to be failing ... is typeof as struct member nayok?)
+
+forall( T, [Nclients], [Ncosts] )
+	void ?{}( T &, request( T, Nclients, Ncosts ) & this ) {}
+
+forall( T &, [Nclients], [Ncosts] )
+	void ^?{}( request( T, Nclients, Ncosts ) & this ) {}
 
 
@@ -15,44 +39,11 @@
 
 
-
-
-
-forall( ztype(Nclients), ztype(Ncosts) )
-struct request {
-    unsigned int requestor_id;
-    array( unsigned int, Nclients ) impacted_client_ids;
-    array( float, Ncosts ) cost_contribs;
-    float total_cost;
-};
-
-
-// TODO: understand (fix?) why these are needed (autogen seems to be failing ... is typeof as struct member nayok?)
-
-forall( ztype(Nclients), ztype(Ncosts) )
-void ?{}( request(Nclients, Ncosts) & this ) {}
-
-forall( ztype(Nclients), ztype(Ncosts) )
-void ^?{}( request(Nclients, Ncosts) & this ) {}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-forall( ztype(Nclients), ztype(Ncosts) )
-void summarize( request(Nclients, Ncosts) & r ) {
+forall( T, [Nclients], [Ncosts] )
+void summarize( request( T, Nclients, Ncosts ) & r ) {
     r.total_cost = 0;
-    for( i; z(Ncosts) )
+    for( i; Ncosts )
         r.total_cost += r.cost_contribs[i];
     // say the cost is per-client, to make output vary
-    r.total_cost *= z(Nclients);
+    r.total_cost *= Nclients;
 }
 
@@ -68,53 +59,19 @@
 
 
+int main( int argc, char * argv[] ) {
+	const int ncl = ato( argv[1] );
+	const int nco = 2;
 
+	request( int, ncl, nco ) r;
+	r.cost_contribs[0] = 100;
+	r.cost_contribs[1] = 0.1;
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-int main( int argc, char ** argv ) {
-
-
-
-const int ncl = atoi(argv[1]);
-const int nco = 2;
-
-request( Z(ncl), Z(nco) ) r;
-r.cost_contribs[0] = 100;
-r.cost_contribs[1] = 0.1;
-
-summarize(r);
-printf("Total cost: %.1f\n", r.total_cost);
-
+	summarize(r);
+	sout | "Total cost:" | r.total_cost;
+}
 /*
-./a.out 5
+$\$$ ./a.out 5
 Total cost: 500.5
-./a.out 6
+$\$$ ./a.out 6
 Total cost: 600.6
 */
-
-
-
-
-}
Index: doc/theses/mike_brooks_MMath/programs/hello-array.cfa
===================================================================
--- doc/theses/mike_brooks_MMath/programs/hello-array.cfa	(revision 57174958a53dde3bf79d4a2b102573e186836bdd)
+++ doc/theses/mike_brooks_MMath/programs/hello-array.cfa	(revision 40ab446132dfae80816ea4fe1e9a484846b04f8e)
@@ -1,28 +1,5 @@
-
-#include <common.hfa>
-#include <bits/align.hfa>
-
-extern "C" {
-    int atoi(const char *str);
-}
-
-
-#include "stdlib.hfa"
-#include "array.hfa" // learned has to come afer stdlib, which uses the word tag
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+#include <fstream.hfa>
+#include <stdlib.hfa>
+#include <array.hfa> // learned has to come afer stdlib, which uses the word tag
 
 // Usage:
@@ -31,28 +8,9 @@
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-forall( ztype( N ) )
+forall( [N] ) // array bound
 array(bool, N) & f( array(float, N) & a, array(float, N) & b ) {
-    array(bool, N) & ret = *alloc();
-    for( i; z(N) ) {
-        float fracdiff = 2 * abs( a[i] - b[i] )
-                       / ( abs( a[i] ) + abs( b[i] ) );
-        ret[i] = fracdiff < 0.005;
+    array(bool, N) & ret = *alloc(); // sizeof used by alloc
+    for( i; N ) {
+        ret[i] = 0.005 > 2 * (abs(a[i] - b[i])) / (abs(a[i]) + abs(b[i]));
     }
     return ret;
@@ -68,85 +26,37 @@
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 // TODO: standardize argv
 
-int main( int argc, char ** argv ) {
-    int n = atoi(argv[1]);
-    array(float, Z(n)) a, b;
-    for (i; n) {
-        a[i] = 3.14 / (i+1);
+int main( int argc, char * argv[] ) {
+    int n = ato( argv[1] );
+    array(float, n) a, b; // VLA
+    for ( i; n ) {
+        a[i] = 3.14 / (i + 1);
         b[i] = a[i] + 0.005 ;
     }
-    array(bool, Z(n)) & answer = f( a, b );
-    printf("answer:");
-    for (i; n)
-        printf(" %d", answer[i]);
-    printf("\n");
-    free( & answer );
+    array(bool, n) & result = f( a, b ); // call
+    sout | "result: " | nonl;
+    for ( i; n )
+        sout | result[i] | nonl;
+    sout | nl;
+    free( &result ); // free returned storage
 }
 /*
-$ ./a.out 5
-answer: 1 1 1 0 0 
-$ ./a.out 7
-answer: 1 1 1 0 0 0 0 
+$\$$ ./a.out 5
+result: true true true false false
+$\$$ ./a.out 7
+result: true true true false false false false
 */
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-forall( ztype(M), ztype(N) )
-void not_so_bad(array(float, M) &a, array(float, N) &b ) {
+void fred() {
+	array(float, 10) a;
+	array(float, 20) b;
     f( a, a );
     f( b, b );
+    f( a, b );
 }
 
-
-
-
-
-
-
 #ifdef SHOWERR1
-
-forall( ztype(M), ztype(N) )
+forall( [M], [N] )
 void bad( array(float, M) &a, array(float, N) &b ) {
     f( a, a ); // ok
@@ -154,51 +64,12 @@
     f( a, b ); // error
 }
-
 #endif
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-forall( ztype(M), ztype(N) )
-void bad_fixed( array(float, M) &a, array(float, N) &b ) {
-    
-
-    if ( z(M) == z(N) ) {
-        f( a, ( array(float, M) & ) b ); // fixed
+forall( [M], [N] )
+void bad_fixed( array(float, M) & a, array(float, N) & b ) {
+    if ( M == N ) {
+        f( a, (array(float, M) &)b ); // cast b to matching type
     }
-
 }
Index: doc/theses/mike_brooks_MMath/programs/hello-md.cfa
===================================================================
--- doc/theses/mike_brooks_MMath/programs/hello-md.cfa	(revision 57174958a53dde3bf79d4a2b102573e186836bdd)
+++ doc/theses/mike_brooks_MMath/programs/hello-md.cfa	(revision 40ab446132dfae80816ea4fe1e9a484846b04f8e)
@@ -1,4 +1,4 @@
-#include "array.hfa"
-
+#include <fstream.hfa>
+#include <array.hfa>
 
 
@@ -60,10 +60,9 @@
 forall( [N] )
 void print1d_cstyle( array(float, N) & c ) {
-    for( i; N ) {
-        printf("%.1f  ", c[i]);
+    for ( i; N ) {
+        sout | c[i] | nonl;
     }
-    printf("\n");
+    sout | nl;
 }
-
 
 
@@ -81,7 +80,7 @@
 void print1d( C & c ) {
     for( i; N ) {
-        printf("%.1f  ", c[i]);
+        sout | c[i] | nonl;
     }
-    printf("\n");
+    sout | nl;
 }
 
@@ -103,13 +102,12 @@
         for ( j; 7 ) {
             a[i,j] = 1.0 * i + 0.1 * j;
-            printf("%.1f  ", a[i,j]);
+            sout | a[[i,j]] | nonl;
         }
-        printf("\n");
+        sout | nl;
     }
-    printf("\n");
+    sout | nl;
 }
 
 int main() {
-
 
 
@@ -128,4 +126,6 @@
 */
     
+
+
 
 
@@ -168,5 +168,2 @@
 
 }
-
-
-
