Index: src/examples/Makefile.am
===================================================================
--- src/examples/Makefile.am	(revision 7ee14bb76642dae5f201576fddc3f11c600f87e4)
+++ src/examples/Makefile.am	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -11,6 +11,6 @@
 ## Created On       : Sun May 31 09:08:15 2015
 ## Last Modified By : Peter A. Buhr
-## Last Modified On : Fri Nov 20 16:03:46 2015
-## Update Count     : 24
+## Last Modified On : Mon Jan 25 22:31:42 2016
+## Update Count     : 25
 ###############################################################################
 
@@ -20,4 +20,4 @@
 
 noinst_PROGRAMS = fstream_test vector_test # build but do not install
-fstream_test_SOURCES = iostream.c fstream.c fstream_test.c iterator.c
-vector_test_SOURCES = vector_int.c fstream.c iostream.c array.c iterator.c vector_test.c
+fstream_test_SOURCES = fstream_test.c
+vector_test_SOURCES = vector_int.c array.c vector_test.c
Index: src/examples/Makefile.in
===================================================================
--- src/examples/Makefile.in	(revision 7ee14bb76642dae5f201576fddc3f11c600f87e4)
+++ src/examples/Makefile.in	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -48,10 +48,8 @@
 CONFIG_CLEAN_VPATH_FILES =
 PROGRAMS = $(noinst_PROGRAMS)
-am_fstream_test_OBJECTS = iostream.$(OBJEXT) fstream.$(OBJEXT) \
-	fstream_test.$(OBJEXT) iterator.$(OBJEXT)
+am_fstream_test_OBJECTS = fstream_test.$(OBJEXT)
 fstream_test_OBJECTS = $(am_fstream_test_OBJECTS)
 fstream_test_LDADD = $(LDADD)
-am_vector_test_OBJECTS = vector_int.$(OBJEXT) fstream.$(OBJEXT) \
-	iostream.$(OBJEXT) array.$(OBJEXT) iterator.$(OBJEXT) \
+am_vector_test_OBJECTS = vector_int.$(OBJEXT) array.$(OBJEXT) \
 	vector_test.$(OBJEXT)
 vector_test_OBJECTS = $(am_vector_test_OBJECTS)
@@ -176,6 +174,6 @@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-fstream_test_SOURCES = iostream.c fstream.c fstream_test.c iterator.c
-vector_test_SOURCES = vector_int.c fstream.c iostream.c array.c iterator.c vector_test.c
+fstream_test_SOURCES = fstream_test.c
+vector_test_SOURCES = vector_int.c array.c vector_test.c
 all: all-am
 
@@ -191,7 +189,7 @@
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/examples/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/examples/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/examples/Makefile
+	  $(AUTOMAKE) --gnu src/examples/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@@ -229,8 +227,5 @@
 
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstream.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstream_test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iostream.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iterator.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector_int.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector_test.Po@am__quote@
Index: src/examples/abs.c
===================================================================
--- src/examples/abs.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
+++ src/examples/abs.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -0,0 +1,40 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// abs.c -- 
+//
+// Author           : Peter A. Buhr
+// Created On       : Thu Jan 28 18:26:16 2016
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Fri Jan 29 15:44:41 2016
+// Update Count     : 20
+//
+
+extern "C" {
+#include <complex.h>
+} // extern
+#include <fstream>
+#include <algorithm>
+
+int main( void ) {
+	ofstream *sout = ofstream_stdout();
+
+	char ch = -65;
+	sout | "char\t\t\t"					| -65    | "\tabs " | abs( ch ) | endl;
+	sout | "signed int\t\t"				| -65    | "\tabs " | abs( -65 ) | endl;
+	sout | "signed long int\t\t" 		| -65l   | "\tabs " | abs( -65l ) | endl;
+	sout | "signed long long int\t"		| -65ll  | "\tabs " | abs( -65ll ) | endl;
+	sout | "float\t\t\t" 				| -65.0f | "\tabs " | abs( -65.0f ) | endl;
+	sout | "double\t\t\t"				| -65.0  | "\tabs " | abs( -65.0 ) | endl;
+	sout | "long double\t\t"			| -65.0l | "\tabs " | abs( -65.0l ) | endl;
+	double _Complex c = -65.0+2.0 * I;
+	sout | "double _Complex\t\t"		| c | "\tabs " | abs( c ) | endl;
+} // main
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa abs.c" //
+// End: //
Index: src/examples/alloc.c
===================================================================
--- src/examples/alloc.c	(revision 7ee14bb76642dae5f201576fddc3f11c600f87e4)
+++ src/examples/alloc.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -1,2 +1,3 @@
+#if 0
 extern "C" {
     typedef long unsigned int size_t;
@@ -15,28 +16,31 @@
     return (T *)calloc( size, sizeof(T) );
 }
+#endif
+typedef int size_t;
 forall( type T ) T * realloc( T *ptr, size_t n ) {
-    return (T *)(void *)realloc( ptr, sizeof(T) );
+//    return (T *)(void *)realloc( ptr, sizeof(T) );
 }
-forall( type T ) T * realloc( T *ptr, size_t n, T c ) {
-    return (T *)realloc( ptr, n );
-}
+//forall( type T ) T * realloc( T *ptr, size_t n, T c ) {
+//    return (T *)realloc( ptr, n );
+//}
 
-int *foo( int *p, int c );
-int *bar( int *p, int c );
-int *baz( int *p, int c );
+//int *foo( int *p, int c );
+//int *bar( int *p, int c );
+//int *baz( int *p, int c );
 
 int main( void ) {
-    size_t size = 10;
-    int * x = malloc();
-    x = malloc();
-    x = calloc( 10 );					// calloc: array set to 0
-    x = realloc( x, 10 );
-    x = realloc( x, 10, '\0' );
-    x = malloc( 5 );
-    float *fp = malloc() + 1;
+    // size_t size = 10;
+    //int * x = malloc();
+    int * x;
+    // x = malloc();
+    // x = calloc( 10 );					// calloc: array set to 0
+    // x = realloc( x, 10 );
+    // x = realloc( x, 10, '\0' );
+    // x = malloc( 5 );
+    // float *fp = malloc() + 1;
 
     struct St1 { int x; double y; };
     struct St1 * st1;
-    double *y;
+//    double *y;
     x = realloc( st1, 10 );				// SHOULD FAIL!!
 #if 0
Index: src/examples/array.h
===================================================================
--- src/examples/array.h	(revision 7ee14bb76642dae5f201576fddc3f11c600f87e4)
+++ src/examples/array.h	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -10,6 +10,6 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed May 27 18:10:32 2015
-// Update Count     : 2
+// Last Modified On : Tue Jan 26 17:09:29 2016
+// Update Count     : 3
 //
 
@@ -17,5 +17,5 @@
 #define ARRAY_H
 
-//#include "iterator.h"
+//#include <iterator>
 
 // An array has contiguous elements accessible in any order using integer indicies. The first
Index: src/examples/constants.c
===================================================================
--- src/examples/constants.c	(revision 7ee14bb76642dae5f201576fddc3f11c600f87e4)
+++ src/examples/constants.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -10,6 +10,6 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Jun  8 20:44:48 2015
-// Update Count     : 75
+// Last Modified On : Mon Jan 25 23:44:12 2016
+// Update Count     : 76
 //
 
@@ -54,5 +54,5 @@
 	L_"\x_ff_ee";
 	L"a_b\r\Qyc\u_00_40  x_y_z\xff_AA";
-	L_"a_b\r\Qyc\u_00_40\    
+	L_"a_b\r\Qyc\u_00_40\
   x_y_z\xff_AA";
 	"abc" "def" "ghi";
Index: src/examples/fstream.c
===================================================================
--- src/examples/fstream.c	(revision 7ee14bb76642dae5f201576fddc3f11c600f87e4)
+++ 	(revision )
@@ -1,127 +1,0 @@
-//
-// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
-//
-// The contents of this file are covered under the licence agreement in the
-// file "LICENCE" distributed with Cforall.
-//
-// fstream.c -- 
-//
-// Author           : Richard C. Bilson
-// Created On       : Wed May 27 17:56:53 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Nov 19 22:43:31 2015
-// Update Count     : 4
-//
-
-#include "fstream.h"
-
-extern "C" {
-#include <stdio.h>
-#include <stdlib.h>
-}
-
-struct ofstream {
-	FILE *file;
-	int fail;
-};
-
-ofstream *write( ofstream *os, const char *data, streamsize_type size ) {
-	if ( ! os->fail ) {
-		fwrite( data, size, 1, os->file );
-		os->fail = ferror( os->file );
-	} // if
-	return os;
-} // write
-
-int fail( ofstream *os ) {
-	return os->fail;
-} // fail
-
-static ofstream *make_ofstream() {
-	ofstream *new_stream = malloc( sizeof( ofstream ) );
-	new_stream->fail = 0;
-	return new_stream;
-} // make_ofstream
-
-ofstream *ofstream_stdout() {
-	ofstream *stdout_stream = make_ofstream();
-	stdout_stream->file = stdout;
-	return stdout_stream;
-} // ofstream_stdout
-
-ofstream *ofstream_stderr() {
-	ofstream *stderr_stream = make_ofstream();
-	stderr_stream->file = stderr;
-	return stderr_stream;
-} // ofstream_stderr
-
-ofstream *ofstream_fromfile( const char *name ) {
-	ofstream *file_stream = make_ofstream();
-	file_stream->file = fopen( name, "w" );
-	file_stream->fail = file_stream->file == 0;
-	return file_stream;
-}
-
-void ofstream_close( ofstream *os ) {
-	if ( os->file != stdout && os->file != stderr ) {
-		os->fail = fclose( os->file );
-	}
-	free( os );
-}
-
-struct ifstream {
-	FILE *file;
-	int fail;
-	int eof;
-};
-
-ifstream *read( ifstream *is, char *data, streamsize_type size ) {
-	if ( ! is->fail && ! is->eof ) {
-		fread( data, size, 1, is->file );
-		is->fail = ferror( is->file );
-		is->eof = feof( is->file );
-	}
-	return is;
-}
-  
-ifstream *unread( ifstream *is, char c ) {
-	if ( ! is->fail ) {
-		if ( ! EOF == ungetc( c, is->file ) ) {
-			is->fail = 1;
-		}
-	}
-	return is;
-}
-
-int fail( ifstream *is ) {
-	return is->fail;
-}
-
-int eof( ifstream *is ) {
-	return is->eof;
-}
-
-static ifstream *make_ifstream() {
-	ifstream *new_stream = malloc( sizeof( ifstream ) );
-	new_stream->fail = 0;
-	new_stream->eof = 0;
-	return new_stream;
-}
-
-ifstream *ifstream_stdin() {
-	ifstream *stdin_stream = make_ifstream();
-	stdin_stream->file = stdin;
-	return stdin_stream;
-}
-
-ifstream *ifstream_fromfile( const char *name ) {
-	ifstream *file_stream = make_ifstream();
-	file_stream->file = fopen( name, "r" );
-	file_stream->fail = file_stream->file == 0;
-	return file_stream;
-}
-
-// Local Variables: //
-// tab-width: 4 //
-// compile-command: "cfa fstream.c" //
-// End: //
Index: src/examples/fstream.h
===================================================================
--- src/examples/fstream.h	(revision 7ee14bb76642dae5f201576fddc3f11c600f87e4)
+++ 	(revision )
@@ -1,48 +1,0 @@
-//
-// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
-//
-// The contents of this file are covered under the licence agreement in the
-// file "LICENCE" distributed with Cforall.
-//
-// fstream.h -- 
-//
-// Author           : Richard C. Bilson
-// Created On       : Wed May 27 17:56:53 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Wed May 27 18:13:08 2015
-// Update Count     : 1
-//
-
-#ifndef __FSTREAM_H__
-#define __FSTREAM_H__
-
-#include "iostream.h"
-
-typedef struct ofstream ofstream;
-
-// implement context ostream
-ofstream *write( ofstream *, const char *, streamsize_type );
-int fail( ofstream * );
-
-ofstream *ofstream_stdout();
-ofstream *ofstream_stderr();
-ofstream *ofstream_fromfile( const char *name );
-void ofstream_close( ofstream *os );
-
-typedef struct ifstream ifstream;
-
-// implement context istream
-ifstream *read( ifstream *, char *, streamsize_type );
-ifstream *unread( ifstream *, char );
-int fail( ifstream * );
-int eof( ifstream * );
-
-ifstream *ifstream_stdin();
-ifstream *ifstream_fromfile( const char *name );
-
-#endif // __FSTREAM_H__
-
-// Local Variables: //
-// tab-width: 4 //
-// compile-command: "cfa fstream.c" //
-// End: //
Index: src/examples/fstream_test.c
===================================================================
--- src/examples/fstream_test.c	(revision 7ee14bb76642dae5f201576fddc3f11c600f87e4)
+++ src/examples/fstream_test.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -10,9 +10,9 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Jan  4 11:30:39 2016
-// Update Count     : 41
+// Last Modified On : Tue Jan 26 17:11:33 2016
+// Update Count     : 42
 //
 
-#include "fstream.h"
+#include <fstream>
 
 int main( void ) {
Index: src/examples/hello.c
===================================================================
--- src/examples/hello.c	(revision 7ee14bb76642dae5f201576fddc3f11c600f87e4)
+++ src/examples/hello.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -10,9 +10,9 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sun Nov 22 17:40:37 2015
-// Update Count     : 5
+// Last Modified On : Tue Jan 26 17:11:49 2016
+// Update Count     : 7
 //
 
-#include "fstream.h"
+#include <fstream>
 
 int main() {
@@ -24,4 +24,4 @@
 // Local Variables: //
 // tab-width: 4 //
-// compile-command: "cfa hello.c fstream.o iostream.o iterator.o" //
+// compile-command: "cfa hello.c" //
 // End: //
Index: src/examples/identity.c
===================================================================
--- src/examples/identity.c	(revision 7ee14bb76642dae5f201576fddc3f11c600f87e4)
+++ src/examples/identity.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -10,9 +10,9 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Jan  4 23:38:05 2016
-// Update Count     : 6
+// Last Modified On : Tue Jan 26 17:11:58 2016
+// Update Count     : 8
 //
 
-#include "fstream.h"
+#include <fstream>
 
 forall( type T )
@@ -37,4 +37,4 @@
 // Local Variables: //
 // tab-width: 4 //
-// compile-command: "cfa identity.c fstream.o iostream.o iterator.o" //
+// compile-command: "cfa identity.c" //
 // End: //
Index: src/examples/iostream.c
===================================================================
--- src/examples/iostream.c	(revision 7ee14bb76642dae5f201576fddc3f11c600f87e4)
+++ 	(revision )
@@ -1,148 +1,0 @@
-//
-// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
-//
-// The contents of this file are covered under the licence agreement in the
-// file "LICENCE" distributed with Cforall.
-//
-// iostream.c -- 
-//
-// Author           : Richard C. Bilson
-// Created On       : Wed May 27 17:56:53 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Jan  4 09:38:58 2016
-// Update Count     : 37
-//
-
-#include "iostream.h"
-extern "C" {
-#include <stdio.h>
-#include <string.h>										// strlen
-}
-
-forall( dtype ostype | ostream( ostype ) )
-ostype * ?|?( ostype *os, char c ) {
-	return write( os, &c, 1 );
-} // ?|?
-
-forall( dtype ostype | ostream( ostype ) )
-ostype * ?|?( ostype *os, int i ) {
-	char buffer[32];
-	return write( os, buffer, sprintf( buffer, "%d", i ) );
-} // ?|?
-
-forall( dtype ostype | ostream( ostype ) )
-ostype * ?|?( ostype *os, unsigned int i ) {
-	char buffer[32];
-	return write( os, buffer, sprintf( buffer, "%u", i ) );
-} // ?|?
-
-forall( dtype ostype | ostream( ostype ) )
-ostype * ?|?( ostype *os, long int i ) {
-	char buffer[32];
-	return write( os, buffer, sprintf( buffer, "%ld", i ) );
-} // ?|?
-
-forall( dtype ostype | ostream( ostype ) )
-ostype * ?|?( ostype *os, long long int i ) {
-	char buffer[32];
-	return write( os, buffer, sprintf( buffer, "%lld", i ) );
-} // ?|?
-
-forall( dtype ostype | ostream( ostype ) )
-ostype * ?|?( ostype *os, unsigned long int i ) {
-	char buffer[32];
-	return write( os, buffer, sprintf( buffer, "%lu", i ) );
-} // ?|?
-
-forall( dtype ostype | ostream( ostype ) )
-ostype * ?|?( ostype *os, unsigned long long int i ) {
-	char buffer[32];
-	return write( os, buffer, sprintf( buffer, "%llu", i ) );
-} // ?|?
-
-forall( dtype ostype | ostream( ostype ) )
-ostype * ?|?( ostype *os, double d ) {
-	char buffer[32];
-	return write( os, buffer, sprintf( buffer, "%g", d ) );
-} // ?|?
-
-forall( dtype ostype | ostream( ostype ) )
-ostype * ?|?( ostype *os, long double d ) {
-	char buffer[32];
-	return write( os, buffer, sprintf( buffer, "%Lg", d ) );
-} // ?|?
-
-forall( dtype ostype | ostream( ostype ) )
-ostype * ?|?( ostype *os, const void *p ) {
-	char buffer[32];
-	return write( os, buffer, sprintf( buffer, "%p", p ) );
-} // ?|?
-
-forall( dtype ostype | ostream( ostype ) )
-ostype * ?|?( ostype *os, const char *cp ) {
-	return write( os, cp, strlen( cp ) );
-} // ?|?
-
-
-forall( dtype ostype, dtype retostype | ostream( ostype ) | ostream( retostype ) ) 
-retostype * ?|?( ostype *os, retostype * (*manip)(ostype*) ) {
-  return manip(os);
-}
-
-forall( dtype ostype | ostream( ostype ) ) 
-ostype * endl( ostype * os ) {
-  os | "\n";
-  // flush
-  return os;
-} // endl
-
-forall( type elt_type | writeable( elt_type ),
-		type iterator_type | iterator( iterator_type, elt_type ),
-		dtype os_type | ostream( os_type ) )
-void write( iterator_type begin, iterator_type end, os_type *os ) {
-	void print( elt_type i ) {
-		os | i | ' ';
-	}
-	for_each( begin, end, print );
-} // ?|?
-
-forall( type elt_type | writeable( elt_type ),
-		type iterator_type | iterator( iterator_type, elt_type ),
-		dtype os_type | ostream( os_type ) )
-void write_reverse( iterator_type begin, iterator_type end, os_type *os ) {
-	void print( elt_type i ) { os | i | ' '; }
-	for_each_reverse( begin, end, print );
-} // ?|?
-
-
-forall( dtype istype | istream( istype ) )
-istype * ?|?( istype *is, char *cp ) {
-	return read( is, cp, 1 );
-} // ?|?
-
-forall( dtype istype | istream( istype ) )
-istype * ?|?( istype *is, int *ip ) {
-	char cur;
-  
-	// skip some whitespace
-	do {
-		is | &cur;
-		if ( fail( is ) || eof( is ) ) return is;
-	} while ( !( cur >= '0' && cur <= '9' ) );
-  
-	// accumulate digits
-	*ip = 0;
-	while ( cur >= '0' && cur <= '9' ) {
-		*ip = *ip * 10 + ( cur - '0' );
-		is | &cur;
-		if ( fail( is ) || eof( is ) ) return is;
-	}
-  
-	unread( is, cur );
-	return is;
-} // ?|?
-
-// Local Variables: //
-// tab-width: 4 //
-// compile-command: "cfa iostream.c" //
-// End: //
Index: src/examples/iostream.h
===================================================================
--- src/examples/iostream.h	(revision 7ee14bb76642dae5f201576fddc3f11c600f87e4)
+++ 	(revision )
@@ -1,84 +1,0 @@
-//
-// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
-//
-// The contents of this file are covered under the licence agreement in the
-// file "LICENCE" distributed with Cforall.
-//
-// iostream.h -- 
-//
-// Author           : Richard C. Bilson
-// Created On       : Wed May 27 17:56:53 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Jan  4 09:02:11 2016
-// Update Count     : 20
-//
-
-#ifndef IOSTREAM_H
-#define IOSTREAM_H
-
-#include "iterator.h"
-
-typedef unsigned long streamsize_type;
-
-context ostream( dtype ostype ) {
-	ostype *write( ostype *, const char *, streamsize_type );
-	int fail( ostype * );
-};
-
-context writeable( type T ) {
-	forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, T );
-};
-
-// implement writable for some intrinsic types
-
-forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, char );
-forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, int );
-forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, unsigned int );
-forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, long int );
-forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, long long int );
-forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, unsigned long int );
-forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, unsigned long long int );
-forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, double );
-forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, long double );
-forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, const char * );
-forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, const void * );
-
-forall( dtype ostype, dtype retostype | ostream( ostype ) | ostream( retostype ) ) retostype * ?|?( ostype *os, retostype * (* manip)(ostype*) );
-forall( dtype ostype | ostream( ostype ) ) ostype * endl( ostype * );
-
-// writes the range [begin, end) to the given stream
-forall( type elt_type | writeable( elt_type ),
-		type iterator_type | iterator( iterator_type, elt_type ),
-		dtype os_type | ostream( os_type ) )
-void write( iterator_type begin, iterator_type end, os_type *os );
-
-forall( type elt_type | writeable( elt_type ),
-		type iterator_type | iterator( iterator_type, elt_type ),
-		dtype os_type | ostream( os_type ) )
-void write_reverse( iterator_type begin, iterator_type end, os_type *os );
-
-//******************************************************************************
-
-context istream( dtype istype ) {
-	istype *read( istype *, char *, streamsize_type );
-	istype *unread( istype *, char );
-	int fail( istype * );
-	int eof( istype * );
-};
-
-context readable( type T ) {
-	forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, T );
-};
-
-forall( dtype istype | istream( istype ) )
-istype * ?|?( istype *, char * );
-
-forall( dtype istype | istream( istype ) )
-istype * ?|?( istype *, int * );
-
-#endif // IOSTREAM_H
-
-// Local Variables: //
-// tab-width: 4 //
-// compile-command: "cfa iostream.c" //
-// End: //
Index: src/examples/iterator.c
===================================================================
--- src/examples/iterator.c	(revision 7ee14bb76642dae5f201576fddc3f11c600f87e4)
+++ 	(revision )
@@ -1,36 +1,0 @@
-//
-// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
-//
-// The contents of this file are covered under the licence agreement in the
-// file "LICENCE" distributed with Cforall.
-//
-// iterator.c -- 
-//
-// Author           : Richard C. Bilson
-// Created On       : Wed May 27 17:56:53 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Nov 19 17:54:37 2015
-// Update Count     : 24
-//
-
-#include "iterator.h"
-
-forall( type iterator_type, type elt_type | iterator( iterator_type, elt_type ) )
-void for_each( iterator_type begin, iterator_type end, void (*func)( elt_type ) ) {
-	for ( iterator_type i = begin; i != end; ++i ) {
-		func( *i );
-	}
-}
-
-forall( type iterator_type, type elt_type | iterator( iterator_type, elt_type ) )
-void for_each_reverse( iterator_type begin, iterator_type end, void (*func)( elt_type ) ) {
-	for ( iterator_type i = end; i != begin; ) {
-		--i;
-		func( *i );
-	}
-}
-
-// Local Variables: //
-// tab-width: 4 //
-// compile-command: "cfa iterator.c" //
-// End: //
Index: src/examples/iterator.h
===================================================================
--- src/examples/iterator.h	(revision 7ee14bb76642dae5f201576fddc3f11c600f87e4)
+++ 	(revision )
@@ -1,51 +1,0 @@
-//
-// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
-//
-// The contents of this file are covered under the licence agreement in the
-// file "LICENCE" distributed with Cforall.
-//
-// iterator.h -- 
-//
-// Author           : Richard C. Bilson
-// Created On       : Wed May 27 17:56:53 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Nov 19 17:58:28 2015
-// Update Count     : 6
-//
-
-#ifndef ITERATOR_H
-#define ITERATOR_H
-
-// An iterator can be used to traverse a data structure.
-context iterator( type iterator_type, type elt_type ) {
-	// point to the next element
-//	iterator_type ?++( iterator_type * );
-	iterator_type ++?( iterator_type * );
-	iterator_type --?( iterator_type * );
-
-	// can be tested for equality with other iterators
-	int ?==?( iterator_type, iterator_type );
-	int ?!=?( iterator_type, iterator_type );
-
-	// dereference to get the pointed-at element
-	lvalue elt_type *?( iterator_type );
-};
-
-context iterator_for( type iterator_type, type collection_type, type elt_type | iterator( iterator_type, elt_type ) ) {
-//	[ iterator_type begin, iterator_type end ] get_iterators( collection_type );
-	iterator_type begin( collection_type );
-	iterator_type end( collection_type );
-};
-
-forall( type iterator_type, type elt_type | iterator( iterator_type, elt_type ) )
-void for_each( iterator_type begin, iterator_type end, void (*func)( elt_type ) );
-
-forall( type iterator_type, type elt_type | iterator( iterator_type, elt_type ) )
-void for_each_reverse( iterator_type begin, iterator_type end, void (*func)( elt_type ) );
-
-#endif // ITERATOR_H
-
-// Local Variables: //
-// tab-width: 4 //
-// compile-command: "cfa iterator.c" //
-// End: //
Index: src/examples/limits.c
===================================================================
--- src/examples/limits.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
+++ src/examples/limits.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -0,0 +1,101 @@
+#include <limits>
+
+int main() {
+// Integral Constants
+
+	short int m = MIN;
+	int m = MIN;
+	long int m = MIN;
+	long long int m = MIN;
+
+	short int M = MAX;
+	unsigned short int M = MAX;
+	int M = MAX;
+	unsigned int M = MAX;
+	long int M = MAX;
+	unsigned long int M = MAX;
+	long long int M = MAX;
+	unsigned long long int M = MAX;
+
+// Floating-Point Constants
+
+	float pi = PI;
+	float pi_2 = PI_2;
+	float pi_4 = PI_4;
+	float _1_pi = _1_PI;
+	float _2_pi = _2_PI;
+	float _2_sqrt_pi = _2_SQRT_PI;
+
+	double pi = PI;
+	double pi_2 = PI_2;
+	double pi_4 = PI_4;
+	double _1_pi = _1_PI;
+	double _2_pi = _2_PI;
+	double _2_SQRT_pi = _2_SQRT_PI;
+
+	long double pi = PI;
+	long double pi_2 = PI_2;
+	long double pi_4 = PI_4;
+	long double _1_pi = _1_PI;
+	long double _2_pi = _2_PI;
+	long double _2_sqrt_pi = _2_SQRT_PI;
+
+	_Complex pi = PI;
+	_Complex pi_2 = PI_2;
+	_Complex pi_4 = PI_4;
+	_Complex _1_pi = _1_PI;
+	_Complex _2_pi = _2_PI;
+	_Complex _2_sqrt_pi = _2_SQRT_PI;
+
+	long _Complex pi = PI;
+	long _Complex pi_2 = PI_2;
+	long _Complex pi_4 = PI_4;
+	long _Complex _1_pi = _1_PI;
+	long _Complex _2_pi = _2_PI;
+	long _Complex _2_sqrt_pi = _2_SQRT_PI;
+
+	float e = E;
+	float log2_e = LOG2_E;
+	float log10_e = LOG10_E;
+	float ln_2 = LN_2;
+	float ln_10 = LN_10;
+	float sqrt_2 = SQRT_2;
+	float _1_sqrt_2 = _1_SQRT_2;
+
+	double e = E;
+	double log2_e = LOG2_E;
+	double log10_e = LOG10_E;
+	double ln_2 = LN_2;
+	double ln_10 = LN_10;
+	double sqrt_2 = SQRT_2;
+	double _1_sqrt_2 = _1_SQRT_2;
+
+	long double e = E;
+	long double log2_e = LOG2_E;
+	long double log10_e = LOG10_E;
+	long double ln_2 = LN_2;
+	long double ln_10 = LN_10;
+	long double sqrt_2 = SQRT_2;
+	long double _1_sqrt_2 = _1_SQRT_2;
+
+	_Complex e = E;
+	_Complex log2_e = LOG2_E;
+	_Complex log10_e = LOG10_E;
+	_Complex ln_2 = LN_2;
+	_Complex ln_10 = LN_10;
+	_Complex sqrt_2 = SQRT_2;
+	_Complex _1_sqrt_2 = _1_SQRT_2;
+
+	long _Complex e = E;
+	long _Complex log2_e = LOG2_E;
+	long _Complex log10_e = LOG10_E;
+	long _Complex ln_2 = LN_2;
+	long _Complex ln_10 = LN_10;
+	long _Complex sqrt_2 = SQRT_2;
+	long _Complex _1_sqrt_2 = _1_SQRT_2;
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa min.c" //
+// End: //
Index: src/examples/min.c
===================================================================
--- src/examples/min.c	(revision 7ee14bb76642dae5f201576fddc3f11c600f87e4)
+++ 	(revision )
@@ -1,43 +1,0 @@
-//
-// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
-//
-// The contents of this file are covered under the licence agreement in the
-// file "LICENCE" distributed with Cforall.
-//
-// min.c -- 
-//
-// Author           : Richard C. Bilson
-// Created On       : Wed May 27 17:56:53 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Jan  4 11:40:51 2016
-// Update Count     : 26
-//
-
-#include "fstream.h"
-
-forall( type T | { int ?<?( T, T ); } )
-T min( const T t1, const T t2 ) {
-	return t1 < t2 ? t1 : t2;
-} // min
-
-int main( void ) {
-	ofstream *sout = ofstream_stdout();
-	// char does not have less than.
-	int ?<?( char op1, char op2 ) { return (int)op1 < (int)op2; }
-
-	sout | "char\t\t\t"					| 'z' | ' ' | 'a' | "\tmin " | min( 'z', 'a' ) | endl;
-	sout | "signed int\t\t"				| 4 | ' ' | 3 | "\tmin " | min( 4, 3 ) | endl;
-	sout | "unsigned int\t\t"			| 4u | ' ' | 3u | "\tmin " | min( 4u, 3u ) | endl;
-	sout | "signed long int\t\t" 		| 4l | ' ' | 3l | "\tmin " | min( 4l, 3l ) | endl;
-	sout | "unsigned long int\t" 		| 4ul | ' ' | 3ul | "\tmin " | min( 4ul, 3ul ) | endl;
-	sout | "signed long long int\t"		| 4ll | ' ' | 3ll | "\tmin " | min( 4ll, 3ll ) | endl;
-	sout | "unsigned long long int\t"	| 4ull | ' ' | 3ull | "\tmin " | min( 4ull, 3ull ) | endl;
-	sout | "float\t\t\t" 				| 4.0f | ' ' | 3.1f | "\tmin " | min( 4.0f, 3.1f ) | endl;
-	sout | "double\t\t\t"				| 4.0 | ' ' | 3.1 | "\tmin " | min( 4.0, 3.1 ) | endl;
-	sout | "long double\t\t"			| 4.0l | ' ' | 3.1l | "\tmin " | min( 4.0l, 3.1l ) | endl;
-} // main
-
-// Local Variables: //
-// tab-width: 4 //
-// compile-command: "cfa min.c fstream.o iostream.o iterator.o" //
-// End: //
Index: src/examples/minmax.c
===================================================================
--- src/examples/minmax.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
+++ src/examples/minmax.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -0,0 +1,51 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// min.c -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Wed May 27 17:56:53 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Thu Jan 28 22:15:14 2016
+// Update Count     : 42
+//
+
+#include <fstream>
+#include <algorithm>
+
+int main( void ) {
+	ofstream *sout = ofstream_stdout();
+	// char does not have less or greater than.
+	int ?<?( char op1, char op2 ) { return (int)op1 < (int)op2; }
+	int ?>?( char op1, char op2 ) { return (int)op1 > (int)op2; }
+
+	sout | "char\t\t\t"					| 'z' | ' ' | 'a' | "\tmin " | min( 'z', 'a' ) | endl;
+	sout | "signed int\t\t"				| 4 | ' ' | 3 | "\tmin " | min( 4, 3 ) | endl;
+	sout | "unsigned int\t\t"			| 4u | ' ' | 3u | "\tmin " | min( 4u, 3u ) | endl;
+	sout | "signed long int\t\t" 		| 4l | ' ' | 3l | "\tmin " | min( 4l, 3l ) | endl;
+	sout | "unsigned long int\t" 		| 4ul | ' ' | 3ul | "\tmin " | min( 4ul, 3ul ) | endl;
+	sout | "signed long long int\t"		| 4ll | ' ' | 3ll | "\tmin " | min( 4ll, 3ll ) | endl;
+	sout | "unsigned long long int\t"	| 4ull | ' ' | 3ull | "\tmin " | min( 4ull, 3ull ) | endl;
+	sout | "float\t\t\t" 				| 4.0f | ' ' | 3.1f | "\tmin " | min( 4.0f, 3.1f ) | endl;
+	sout | "double\t\t\t"				| 4.0 | ' ' | 3.1 | "\tmin " | min( 4.0, 3.1 ) | endl;
+	sout | "long double\t\t"			| 4.0l | ' ' | 3.1l | "\tmin " | min( 4.0l, 3.1l ) | endl;
+	sout | endl;
+	sout | "char\t\t\t"					| 'z' | ' ' | 'a' | "\tmax " | max( 'z', 'a' ) | endl;
+	sout | "signed int\t\t"				| 4 | ' ' | 3 | "\tmax " | max( 4, 3 ) | endl;
+	sout | "unsigned int\t\t"			| 4u | ' ' | 3u | "\tmax " | max( 4u, 3u ) | endl;
+	sout | "signed long int\t\t" 		| 4l | ' ' | 3l | "\tmax " | max( 4l, 3l ) | endl;
+	sout | "unsigned long int\t" 		| 4ul | ' ' | 3ul | "\tmax " | max( 4ul, 3ul ) | endl;
+	sout | "signed long long int\t"		| 4ll | ' ' | 3ll | "\tmax " | max( 4ll, 3ll ) | endl;
+	sout | "unsigned long long int\t"	| 4ull | ' ' | 3ull | "\tmax " | max( 4ull, 3ull ) | endl;
+	sout | "float\t\t\t" 				| 4.0f | ' ' | 3.1f | "\tmax " | max( 4.0f, 3.1f ) | endl;
+	sout | "double\t\t\t"				| 4.0 | ' ' | 3.1 | "\tmax " | max( 4.0, 3.1 ) | endl;
+	sout | "long double\t\t"			| 4.0l | ' ' | 3.1l | "\tmax " | max( 4.0l, 3.1l ) | endl;
+} // main
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa minmax.c" //
+// End: //
Index: src/examples/new.c
===================================================================
--- src/examples/new.c	(revision 7ee14bb76642dae5f201576fddc3f11c600f87e4)
+++ src/examples/new.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -10,6 +10,6 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed May 27 18:23:55 2015
-// Update Count     : 1
+// Last Modified On : Mon Jan 25 23:33:55 2016
+// Update Count     : 2
 //
 
@@ -25,5 +25,4 @@
 	t - 4;
 	t[7];
-	7[t];
 }
 
Index: src/examples/quad.c
===================================================================
--- src/examples/quad.c	(revision 7ee14bb76642dae5f201576fddc3f11c600f87e4)
+++ src/examples/quad.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -10,11 +10,9 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed May 27 18:26:36 2015
-// Update Count     : 2
+// Last Modified On : Tue Jan 26 17:13:48 2016
+// Update Count     : 5
 //
 
-extern "C" {
-#include <stdio.h>
-}
+#include <fstream>
 
 forall( type T | { T ?*?( T, T ); } )
@@ -29,6 +27,7 @@
 
 int main() {
+	ofstream *sout = ofstream_stdout();
 	int N = 2;
-	printf( "result of quad of %d is %d\n", N, quad( N ) );
+	sout | "result of quad of " | N | " is " | quad( N ) | endl;
 }
 
Index: src/examples/quoted_keyword.c
===================================================================
--- src/examples/quoted_keyword.c	(revision 7ee14bb76642dae5f201576fddc3f11c600f87e4)
+++ src/examples/quoted_keyword.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -10,9 +10,9 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sun Jan  3 22:46:28 2016
-// Update Count     : 7
+// Last Modified On : Tue Jan 26 17:13:58 2016
+// Update Count     : 8
 //
 
-#include "fstream.h"
+#include <fstream>
 
 // test quoted keyword usage
Index: src/examples/square.c
===================================================================
--- src/examples/square.c	(revision 7ee14bb76642dae5f201576fddc3f11c600f87e4)
+++ src/examples/square.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -10,9 +10,9 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Jan  5 18:08:20 2016
-// Update Count     : 21
+// Last Modified On : Tue Jan 26 17:14:16 2016
+// Update Count     : 25
 //
 
-#include "fstream.h"
+#include <fstream>
 
 forall( type T | { T ?*?( T, T ); } )
@@ -35,5 +35,5 @@
 	sout | square( s ) | endl;
 #endif
-	short int s = 9;
+	short s = 9;
 	square( s );
 #if 0
@@ -69,4 +69,4 @@
 // Local Variables: //
 // tab-width: 4 //
-// compile-command: "cfa square.c fstream.o iostream.o iterator.o" //
+// compile-command: "cfa square.c" //
 // End: //
Index: src/examples/sum.c
===================================================================
--- src/examples/sum.c	(revision 7ee14bb76642dae5f201576fddc3f11c600f87e4)
+++ src/examples/sum.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -10,9 +10,9 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Jan  4 07:40:24 2016
-// Update Count     : 126
+// Last Modified On : Thu Jan 28 17:05:53 2016
+// Update Count     : 130
 //
 
-#include "fstream.h"
+#include <fstream>
 
 context sumable( type T ) {
@@ -22,5 +22,5 @@
 	T ++?( T * );
 	T ?++( T * );
-};
+}; // sumable
 
 forall( type T | sumable( T ) )
@@ -30,5 +30,5 @@
 		total += a[i];									// select +
 	return total;
-}
+} // sum
 
 // Required to satisfy sumable as char does not have addition.
@@ -61,4 +61,13 @@
 		 | sum( size, (int *)a ) | ", check " | (int)s | endl;
 
+	float s = 0.0, a[size];
+	float v = low / 10.0;
+	for ( int i = 0; i < size; i += 1, v += 0.1f ) {
+		s += (float)v;
+		a[i] = (float)v;
+	}
+	sout | "sum from " | low / 10.0 | " to " | High / 10.0 | " is "
+		 | sum( size, (float *)a ) | ", check " | (float)s | endl;
+
 	double s = 0.0, a[size];
 	double v = low / 10.0;
@@ -69,17 +78,8 @@
 	sout | "sum from " | low / 10.0 | " to " | High / 10.0 | " is "
 		 | sum( size, (double *)a ) | ", check " | (double)s | endl;
-
-	float s = 0.0, a[size];
-	float v = low / 10.0;
-	for ( int i = 0; i < size; i += 1, v += 0.1f ) {
-		s += (float)v;
-		a[i] = (float)v;
-	}
-	sout | "sum from " | low / 10.0 | " to " | High / 10.0 | " is "
-		 | sum( size, (float *)a ) | ", check " | (float)s | endl;
-}
+} // main
 
 // Local Variables: //
 // tab-width: 4 //
-// compile-command: "cfa sum.c fstream.o iostream.o iterator.o" //
+// compile-command: "cfa sum.c" //
 // End: //
Index: src/examples/swap.c
===================================================================
--- src/examples/swap.c	(revision 7ee14bb76642dae5f201576fddc3f11c600f87e4)
+++ src/examples/swap.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -10,9 +10,9 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Jan  4 11:32:25 2016
-// Update Count     : 5
+// Last Modified On : Tue Jan 26 16:49:41 2016
+// Update Count     : 7
 //
 
-#include "fstream.h"
+#include <fstream>
 
 forall( type T )
@@ -33,4 +33,4 @@
 // Local Variables: //
 // tab-width: 4 //
-// compile-command: "cfa swap.c fstream.o iostream.o iterator.o" //
+// compile-command: "cfa swap.c" //
 // End: //
Index: src/examples/twice.c
===================================================================
--- src/examples/twice.c	(revision 7ee14bb76642dae5f201576fddc3f11c600f87e4)
+++ src/examples/twice.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -10,9 +10,9 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Jan  4 11:32:04 2016
-// Update Count     : 10
+// Last Modified On : Tue Jan 26 17:14:44 2016
+// Update Count     : 12
 //
 
-#include "fstream.h"
+#include <fstream>
 
 forall( type T | { T ?+?( T, T ); T ?++( T * ); [T] ?+=?( T *, T ); } )
@@ -33,4 +33,4 @@
 // Local Variables: //
 // tab-width: 4 //
-// compile-command: "cfa twice.c fstream.o iostream.o iterator.o" //
+// compile-command: "cfa twice.c" //
 // End: //
Index: src/examples/vector_test.c
===================================================================
--- src/examples/vector_test.c	(revision 7ee14bb76642dae5f201576fddc3f11c600f87e4)
+++ src/examples/vector_test.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -10,12 +10,12 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Jan  4 11:31:56 2016
-// Update Count     : 14
+// Last Modified On : Tue Jan 26 17:14:52 2016
+// Update Count     : 17
 //
 
-#include "fstream.h"
+#include <fstream>
+#include <iterator>
 #include "vector_int.h"
 #include "array.h"
-#include "iterator.h"
 
 int main( void ) {
@@ -46,4 +46,4 @@
 // Local Variables: //
 // tab-width: 4 //
-// compile-command: "cfa vector_test.c fstream.o iostream.o vector_int.o iterator.o array.o" //
+// compile-command: "cfa vector_test.c vector_int.o array.o" //
 // End: //
