Index: src/tests/array.h
===================================================================
--- src/tests/array.h	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
+++ src/tests/array.h	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
@@ -0,0 +1,54 @@
+//
+// 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.
+//
+// array.h --
+//
+// Author           : Richard C. Bilson
+// Created On       : Wed May 27 17:56:53 2015
+// Last Modified By : Rob Schluntz
+// Last Modified On : Wed Apr 27 17:26:04 2016
+// Update Count     : 5
+//
+
+#ifndef ARRAY_H
+#define ARRAY_H
+
+//#include <iterator>
+
+// An array has contiguous elements accessible in any order using integer indicies. The first
+// element has index 0.
+trait array( otype array_type, otype elt_type ) {
+	lvalue elt_type ?[?]( array_type, int );
+};
+
+// A bounded array is an array that carries its maximum index with it.
+trait bounded_array( otype array_type, otype elt_type | array( array_type *, elt_type ) ) {
+	int last( array_type * );
+};
+
+// implement iterator_for
+
+typedef int array_iterator;
+
+/// forall( otype array_type, elt_type | bounded_array( array_type, elt_type ) )
+/// [ array_iterator begin, array_iterator end ] get_iterators( array_type );
+
+
+// A bounded array can be iterated over by using a pointer to the element type. These functions
+// return iterators corresponding to the first element and the one-past-the-end element, STL-style.
+forall( otype array_type, otype elt_type | bounded_array( array_type, elt_type ) )
+elt_type * begin( array_type * array );
+
+// The end iterator should point one past the last element.
+forall( otype array_type, otype elt_type | bounded_array( array_type, elt_type ) )
+elt_type * end( array_type * array );
+
+#endif // ARRAY_H
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa array.c" //
+// End: //
Index: src/tests/avltree/avl-private.c
===================================================================
--- src/tests/avltree/avl-private.c	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
+++ src/tests/avltree/avl-private.c	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
@@ -0,0 +1,134 @@
+#include "avl.h"
+#include "avl-private.h"
+
+// AVL tree specific (internal) operations:
+// rotateLeft, rotateRight, fix
+//
+// AVL tree enhanced height operation
+//
+// calcBalance is a simple computation of height(R) - height(L)
+
+// an AVL tree's height is easy to compute
+// just follow path with the larger balance
+forall(otype K | Comparable(K), otype V)
+int height(tree(K, V) * t){
+  int helper(tree(K, V) * t, int ht){
+    if (empty(t)){
+      return ht;
+    } else if (t->balance > 0){
+      return helper(t->right, 1+ht);
+    } else {
+      // can traverse either branch to find the height
+      // of an AVL tree whose balance is 0
+      return helper(t->left, 1+ht);
+    }
+  }
+  return helper(t, 0);
+}
+
+forall(otype K | Comparable(K), otype V)
+int calcBalance(tree(K, V) * t){
+  int l = height(t->left);
+  int r = height(t->right);
+  t->balance = r-l;
+  return t->balance;
+}
+
+// re-establish the link between parent and child
+forall(otype K | Comparable(K), otype V)
+void relinkToParent(tree(K, V) * t){
+  tree(K, V) * parent = t->parent; // FIX ME!!
+  if (empty(t->parent)){
+    return;
+  } else if (parent->key < t->key){
+    parent->right = t;
+  } else {
+    parent->left = t;
+  }
+}
+
+// rotate left from t
+forall(otype K | Comparable(K), otype V)
+tree(K, V) * rotateLeft(tree(K, V) * t){
+  tree(K, V) * newRoot = t->right;
+  t->right = newRoot->left;
+  newRoot->left = t;
+
+  // swap parents
+  newRoot->parent = t->parent;
+  t->parent = newRoot;
+  if (t->right != NULL) {
+    tree(K, V) * right = t->right; // FIX ME!!
+    right->parent = t;
+  }
+  // re-establish the link between newRoot and its parent
+  relinkToParent(newRoot);
+  return newRoot;
+}
+
+// rotate right from t
+forall(otype K | Comparable(K), otype V)
+tree(K, V) * rotateRight(tree(K, V) * t){
+  tree(K, V) * newRoot = t->left;
+  t->left = newRoot->right;
+  newRoot->right = t;
+
+  // swap parents
+  newRoot->parent = t->parent;
+  t->parent = newRoot;
+  if (t->left != NULL){
+    tree(K, V) * left = t->left; // FIX ME!!
+    left->parent = t;
+  }
+  // re-establish the link between newRoot and its parent
+  relinkToParent(newRoot);
+  return newRoot;
+}
+
+// balances a node that has balance factor -2 or 2
+forall(otype K | Comparable(K), otype V)
+tree(K, V) * fix(tree(K, V) * t){
+  // ensure that t's balance factor is one of
+  // the appropriate values
+  assert(t->balance == 2 || t->balance == -2);
+
+  if (t->balance == -2){
+    tree(K, V) * left = t->left; // FIX ME!!
+    if (left->balance == 1){
+      t->left = rotateLeft(t->left);
+    }
+    return rotateRight(t);
+  } else if (t->balance == 2){
+    tree(K, V) * right = t->right; // FIX ME!!
+    if (right->balance == -1){
+      t->right = rotateRight(t->right);
+    }
+    return rotateLeft(t);
+  } else {
+    // shouldn't ever get here
+    assert((int)0);
+    return t;
+  }
+}
+
+// attempt to fix the tree, if necessary
+forall(otype K | Comparable(K), otype V)
+tree(K, V) * tryFix(tree(K, V) * t){
+  int b = calcBalance(t);
+
+  if (b == -2 || b == 2){
+    t = fix(t);
+  } else {
+    assert(b == 0 || b == 1 || b == -1);
+  }
+  return t;
+}
+
+// sets parent field of c to be p
+forall(otype K | Comparable(K), otype V)
+void setParent(tree(K, V) * c, tree(K, V) * p){
+  if (! empty(c)){
+    c->parent = p;
+  }
+}
+
Index: src/tests/avltree/avl-private.h
===================================================================
--- src/tests/avltree/avl-private.h	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
+++ src/tests/avltree/avl-private.h	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
@@ -0,0 +1,17 @@
+#ifndef AVL_PRIVATE_H
+#include "avl.h"
+
+// functions that really shouldn't be exposed, but are to reduce compilation time
+
+// attempt to fix the tree, if necessary
+forall(otype K | Comparable(K), otype V)
+tree(K, V) * tryFix(tree(K, V) * t);
+
+// sets parent field of c to be p
+forall(otype K | Comparable(K), otype V)
+void setParent(tree(K, V) * c, tree(K, V) * p);
+
+forall(otype K | Comparable(K), otype V)
+int height(tree(K, V) * t);
+
+#endif
Index: src/tests/avltree/avl.h
===================================================================
--- src/tests/avltree/avl.h	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
+++ src/tests/avltree/avl.h	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
@@ -0,0 +1,108 @@
+#ifndef AVL_TREE_H
+#define AVL_TREE_H
+
+extern "C" {
+#define NULL 0
+void free(void *);
+#define assert(cond) if (! (cond)) { printf("Assertion failed: (%s) at %s:%d\n", #cond, __FILE__, __LINE__); abort(); }
+void abort();
+int printf(const char *, ...);
+}
+
+// #include <types.h>
+// #include <lib.h>
+
+trait Comparable(otype T) {
+  int ?<?(T, T);
+};
+
+forall(otype T | Comparable(T))
+int ?==?(T t1, T t2);
+
+forall(otype T | Comparable(T))
+int ?>?(T t1, T t2);
+
+forall(dtype T | { void ^?{}(T *); })
+void delete(T * x);
+
+// To-do: properly use height or balance factor
+// Right now I'm recomputing the height for each
+// node multiple times. It's Theta-log(n), but still..
+
+// Balanced Binary Search Tree of void pointers; almost an AVL tree -
+//   just needs to make use of the balance factor properly
+// Operations:
+// ?{}, ^?{}
+// create   - allocate a new tree. Just a wrapper around malloc which also calls the tree constructor.
+// find     - search through the tree for the given key; return the associated value
+// empty    - return true if the tree is empty
+// insert   - insert node with key and value pair. Returns 0 on success
+// remove   - remove node with the given key, returns 0 on success, 1 on failure
+// copy     - deep copy of a tree
+// for_each - applies the given function to every data element in the tree
+//    assumes that a non-zero return value is an error, will return
+//    the error code from func
+
+// temporary: need forward decl to get around typedef problem
+forall(otype K | Comparable(K), otype V)
+struct tree;
+
+forall(otype K | Comparable(K), otype V)
+struct tree {
+  K key;
+  V value;
+  tree(K, V) * parent;
+  tree(K, V) * left;
+  tree(K, V) * right;
+  int balance;
+};
+
+forall(otype K | Comparable(K), otype V)
+void ?{}(tree(K, V) *t, K key, V value);
+
+forall(otype K | Comparable(K), otype V)
+void ^?{}(tree(K, V) * t);
+
+forall(otype K | Comparable(K), otype V)
+tree(K, V) * create(K key, V value);
+
+forall(otype K | Comparable(K), otype V)
+V * find(tree(K, V) * t, K key);
+
+forall(otype K | Comparable(K), otype V)
+int empty(tree(K, V) * t);
+
+// returns the root of the tree
+forall(otype K | Comparable(K), otype V)
+int insert(tree(K, V) ** t, K key, V value);
+
+forall(otype K | Comparable(K), otype V)
+int remove(tree(K, V) ** t, K key);
+
+forall(otype K | Comparable(K), otype V)
+void copy(tree(K, V) * src, tree(K, V) ** ret);
+
+forall(otype K | Comparable(K), otype V)
+void for_each(tree(K, V) * t, void (*func)(V));
+
+// // Helper function to print trees
+// forall(otype K | Comparable(K), otype V)
+// void printTree(tree * t, int level){
+//   if (empty(t)){
+//     return;
+//   }
+
+//   printTree(t->left, level+1);
+//   printf("key: %d, value: %s, level: %d\n", t->key, t->value, level);
+//   printTree(t->right, level+1);
+// }
+
+// // inorder traversal of t
+// // prints each key, followed by the value
+// forall(otype K | Comparable(K), otype V)
+// void printTree(tree(K, V) * t){
+//     printTree(t, 0);
+// }
+
+
+#endif
Index: src/tests/avltree/avl0.c
===================================================================
--- src/tests/avltree/avl0.c	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
+++ src/tests/avltree/avl0.c	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
@@ -0,0 +1,19 @@
+#include "avl.h"
+
+forall(otype T | Comparable(T))
+int ?==?(T t1, T t2) {
+  return !(t1 < t2) && !(t2 < t1);
+}
+
+forall(otype T | Comparable(T))
+int ?>?(T t1, T t2) {
+  return t2 < t1;
+}
+
+forall(dtype T | { void ^?{}(T *); })
+void delete(T * x) {
+  if (x) {
+    ^?{}(x);
+    free(x);
+  }
+}
Index: src/tests/avltree/avl1.c
===================================================================
--- src/tests/avltree/avl1.c	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
+++ src/tests/avltree/avl1.c	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
@@ -0,0 +1,51 @@
+#include "avl.h"
+// #include "cwrap.h"
+
+extern "C" {
+  void * malloc(long int);
+}
+
+forall(otype K | Comparable(K), otype V)
+void ?{}(tree(K, V) *t, K key, V value){
+  (&t->key) { key };
+  (&t->value) { value };
+  t->parent = NULL;
+  t->left = NULL;
+  t->right = NULL;
+  t->balance = 0;
+}
+
+forall(otype K | Comparable(K), otype V)
+void ^?{}(tree(K, V) * t){
+  delete(t->left);
+  delete(t->right);
+  ^(&t->key){};
+  ^(&t->value){};
+}
+
+forall(otype K | Comparable(K), otype V)
+tree(K, V) * create(K key, V value) {
+  // infinite loop trying to resolve ... t = malloc();
+  tree(K, V) * t = malloc(sizeof(tree(K,V)));
+  t { key, value };
+  return t;
+}
+
+// // Helper function to print trees
+// forall(otype K | Comparable(K), otype V)
+// void printTree(tree * t, int level){
+//   if (empty(t)){
+//     return;
+//   }
+
+//   printTree(t->left, level+1);
+//   printf("key: %d, value: %s, level: %d\n", t->key, t->value, level);
+//   printTree(t->right, level+1);
+// }
+
+// // inorder traversal of t
+// // prints each key, followed by the value
+// forall(otype K | Comparable(K), otype V)
+// void printTree(tree(K, V) * t){
+//     printTree(t, 0);
+// }
Index: src/tests/avltree/avl2.c
===================================================================
--- src/tests/avltree/avl2.c	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
+++ src/tests/avltree/avl2.c	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
@@ -0,0 +1,84 @@
+#include "avl.h"
+#include "avl-private.h"
+
+forall(otype K | Comparable(K), otype V)
+V * find(tree(K, V) * t, K key){
+  if (empty(t)){
+    return NULL;
+  }
+
+  if (t->key == key){
+    return &t->value;
+  } else if (t->key < key){
+    return find(t->right, key);
+  } else {
+    // t->key > key
+    return find(t->left, key);
+  }
+}
+
+forall(otype K | Comparable(K), otype V)
+int empty(tree(K, V) * t){
+  return t == NULL;
+}
+
+// returns the root of the tree
+forall(otype K | Comparable(K), otype V)
+int insert(tree(K, V) ** t, K key, V value) {
+  // handles a non-empty tree
+  // problem if the following signature is used: tries to use an adapter to call helper, but shouldn't
+  // be necessary - seems to be a problem with helper's type variables not being renamed
+  // tree(K, V) * helper(tree(K, V) * t, K key, V value){
+  tree(K, V) * helper(tree(K, V) * t){
+    if (t->key == key){
+      // ran into the same key - uh-oh
+      return NULL;
+    } else if (t->key < key){
+      if (t->right == NULL){
+        t->right = create(key, value);
+        tree(K, V) * right = t->right; // FIX ME!
+        right->parent = t;             // !!!!!!!
+        return t->right;
+      } else {
+        return helper(t->right);
+      }
+    } else {
+      if (t->left == NULL){
+        t->left = create(key, value);
+        tree(K, V) * left = t->left;   // FIX ME!
+        left->parent = t;              // !!!!!!!
+        return t->left;
+      } else {
+        return helper(t->left);
+      }
+    }
+  }
+
+  if (empty(*t)){
+    // be nice and return a new tree
+    *t = create(key, value);
+    return 0;
+  }
+  tree(K, V) * newTree = helper(*t);
+  if (newTree == NULL){
+    // insert error handling code, only possibility
+    // currently is that the key already exists
+    return 99;
+  }
+  // move up the tree, updating balance factors
+  // if the balance factor is -1, 0, or 1 keep going
+  // if the balance factor is -2 or 2, call fix
+  while (newTree->parent != NULL){ // loop until newTree == NULL?
+    newTree = tryFix(newTree);
+    tree(K, V) * parent = newTree->parent;  // FIX ME!!
+    assert(parent->left == newTree ||
+         parent->right == newTree);
+    newTree = newTree->parent;
+  }
+  insert(t, key, value);
+
+  // do it one more time - this is the root
+  newTree = tryFix(newTree);
+  *t = newTree;
+  return 0;
+}
Index: src/tests/avltree/avl3.c
===================================================================
--- src/tests/avltree/avl3.c	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
+++ src/tests/avltree/avl3.c	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
@@ -0,0 +1,117 @@
+#include "avl.h"
+#include "avl-private.h"
+
+// from stdlib
+forall(otype T)
+void swap(T *, T *);
+
+// swaps the data within two tree nodes
+forall(otype K | Comparable(K), otype V)
+void node_swap(tree(K, V) * t, tree(K, V) * t2){
+  swap(&t->key, &t2->key);
+  swap(&t->value, &t2->value);
+}
+
+// go left as deep as possible from within the right subtree
+forall(otype K | Comparable(K), otype V)
+tree(K, V) * find_successor(tree(K, V) * t){
+  tree(K, V) * find_successor_helper(tree(K, V) * t){
+    // go left as deep as possible, return the last node
+    if (empty(t->left)){
+      return t;
+    } else {
+      return find_successor_helper(t->left);
+    }
+  }
+  return find_successor_helper(t->right);
+}
+
+// cleanup - don't want to deep delete, so set children to NULL first.
+forall(otype K | Comparable(K), otype V)
+void deleteSingleNode(tree(K, V) * t) {
+  t->left = NULL;
+  t->right = NULL;
+  deleteSingleNode(t);
+}
+
+// does the actual remove operation once we've found the node in question
+forall(otype K | Comparable(K), otype V)
+tree(K, V) * remove_node(tree(K, V) * t){
+  // is the node a leaf?
+  if (empty(t->left) && empty(t->right)){
+    // yes, just delete this node
+    delete(t);
+    return NULL;
+  } else if (empty(t->left)){
+    // if the left is empty, there is only one child -> move right up
+    node_swap(t, t->right);
+    tree(K, V) * tmp = t->right;
+
+    // relink tree
+    t->left = tmp->left;
+    t->right = tmp->right;
+
+    setParent(t->left, t);
+    setParent(t->right, t);
+    deleteSingleNode(tmp);
+    return t;
+  } else if (empty(t->right)){
+    // if the right is empty, there is only one child -> move left up
+    node_swap(t, t->left);
+    tree(K, V) * tmp = t->left;
+
+    // relink tree
+    t->left = tmp->left;
+    t->right = tmp->right;
+
+    setParent(t->left, t);
+    setParent(t->right, t);
+    deleteSingleNode(tmp);
+    return t;
+  } else {
+    // swap with the successor
+    tree(K, V) * s = find_successor(t);
+    tree(K, V) * parent = s->parent;
+
+    if (parent->left == s){
+      parent->left = s->right;
+    } else {
+      assert(parent->right == s);
+      parent->right = s->right;
+    }
+    setParent(s->right, parent);
+    node_swap(t, s);
+    deleteSingleNode(s);
+    return t;
+  }
+}
+
+// finds the node that needs to be removed
+forall(otype K | Comparable(K), otype V)
+tree(K, V) * remove_helper(tree(K, V) * t, K key, int * worked){
+  if (empty(t)){
+    // did not work because key was not found
+    // set the status variable and return
+    *worked = 1;
+  } else if (t->key == key) {
+    t = remove_node(t);
+  } else if (t->key < key){
+    t->right = remove_helper(t->right, key, worked);
+  } else {
+    // t->key > key
+    t->left = remove_helper(t->left, key, worked);
+  }
+  // try to fix after deleting
+  if (! empty(t)) {
+    t = tryFix(t);
+  }
+  return t;
+}
+
+forall(otype K | Comparable(K), otype V)
+int remove(tree(K, V) ** t, K key){
+  int worked = 0;
+  tree(K, V) * newTree = remove_helper(*t, key, &worked);
+  *t = newTree;
+  return worked;
+}
Index: src/tests/avltree/avl4.c
===================================================================
--- src/tests/avltree/avl4.c	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
+++ src/tests/avltree/avl4.c	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
@@ -0,0 +1,48 @@
+#include "avl.h"
+#include "avl-private.h"
+
+// Perform a shallow copy of src, return the
+// new tree in ret
+forall(otype K | Comparable(K), otype V)
+int copy(tree(K, V) * src, tree(K, V) ** ret){
+  tree(K, V) * helper(tree(K, V) * t, int * worked){
+    if (empty(t)){
+      // given empty tree, return empty tree
+      return NULL;
+    }
+
+    // otherwise, this is not an empty node,
+    // create a new node
+    tree(K, V) * newTree = create(t->key, t->value);
+    if (empty(newTree)) {
+      *worked = 1;
+      return NULL;
+    }
+
+    // recursively copy the left and right branches
+    newTree->left = helper(t->left, worked);
+    newTree->right = helper(t->right, worked);
+
+    setParent(newTree->left, newTree);
+    setParent(newTree->right, newTree);
+    return newTree;
+  }
+
+  int worked = 0;
+  *ret = helper(src, &worked);
+  return worked;
+}
+
+// Apply func to every value element in t, using an in order traversal
+forall(otype K | Comparable(K), otype V)
+void for_each(tree(K, V) * t, int (*func)(V)) {
+  if (t == NULL) {
+    return;
+  }
+  // recursively apply the function to the left,
+  // apply the function to this node,
+  // recursively apply the function to the right
+  for_each(t->left, func);
+  func(t->value);
+  for_each(t->right, func);
+}
Index: src/tests/avltree/avl_test.c
===================================================================
--- src/tests/avltree/avl_test.c	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
+++ src/tests/avltree/avl_test.c	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
@@ -0,0 +1,51 @@
+#include "avl.h"
+#include "avl-private.h"
+
+extern "C" {
+  int printf(const char *, ...);
+  int strcmp(const char *, const char *);
+}
+
+int main(){
+  // operations:
+  // find(tree(K, V) *, K)
+  // int empty(tree(K, V) *);
+  // tree(K, V) * insert(tree(K, V) *, K, V);
+  // int remove(tree(K, V) **, K);
+
+  // int -> int
+  tree(int, int) * imap = create(-1, 0);
+  insert(&imap, 12, 13);
+  insert(&imap, 2, 3);
+  assert( height(imap) == 2 );
+
+  printf("%d %d %d\n", *find(imap, 2), *find(imap, 12), *find(imap, -1));
+
+  remove(&imap, -1);
+  delete(imap);
+
+  // int -> char *
+  tree(int, char *) * smap = create(-1, "baz");
+  insert(&smap, 12, "bar");
+  insert(&smap, 2, "foo");
+  assert( height(smap) == 2 );
+
+  printf("%s %s %s\n", *find(smap, 2), *find(smap, 12), *find(smap, -1));
+
+  remove(&smap, -2);
+  delete(smap);
+
+  // char* -> char*
+  int ?<?(char *a, char *b) {
+    return strcmp(a,b) < 0;
+  }
+  tree(char *, char *) * ssmap = create("queso", "cheese");
+  insert(&ssmap, "foo", "bar");
+  insert(&ssmap, "hello", "world");
+  assert( height(ssmap) == 2 );
+
+  printf("%s %s %s\n", *find(ssmap, "hello"), *find(ssmap, "foo"), *find(ssmap, "queso"));
+
+  remove(&ssmap, "foo");
+  delete(ssmap);
+}
Index: src/tests/io.c
===================================================================
--- src/tests/io.c	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
+++ src/tests/io.c	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
@@ -0,0 +1,106 @@
+//                               -*- Mode: C -*- 
+// 
+// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+// 
+// io.c -- 
+// 
+// Author           : Peter A. Buhr
+// Created On       : Wed Mar  2 16:56:02 2016
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Thu May 26 10:06:00 2016
+// Update Count     : 28
+// 
+
+#include <fstream>
+
+int main() {
+	char c;														// basic types
+	short int si;
+	unsigned short int usi;
+	int i;
+	unsigned int ui;
+	long int li;
+	unsigned long int uli;
+	long long int lli;
+	unsigned long long int ulli;
+	float f;
+	double d;
+	long double ld;
+	float _Complex fc;
+	double _Complex dc;
+	long double _Complex ldc;
+	char s1[10], s2[10];
+
+	ifstream in;												// create / open file
+	open( &in, "io.data", "r" );
+
+	&in | &c													// character
+		| &si | &usi | &i | &ui | &li | &uli | &lli | &ulli		// integral
+		| &f | &d | &ld											// floating point
+		| &fc | &dc | &ldc										// floating-point complex
+		| cstr( s1 ) | cstr( s2, 10 );							// C string, length unchecked and checked
+
+	sout | c | ' ' | endl										// character
+		 | si | usi | i | ui | li | uli | lli | ulli | endl		// integral
+		 | f | d | ld | endl									// floating point
+		 | fc | dc | ldc | endl;								// complex
+	sout | endl;
+	sout | f | "" | d | "" | ld | endl							// floating point without separator
+		 | sepDisable | fc | dc | ldc | sepEnable | endl		// complex without separator
+		 | sepOn | s1 | sepOff | s2 | endl						// local separator removal
+		 | s1 | "" | s2 | endl;									// C string without separator
+	sout | endl;
+
+	sepSet( sout, ", $" );										// change separator, maximum of 15 characters
+	sout | f | d | ld | endl									// floating point without separator
+		 | fc | dc | ldc | endl									// complex without separator
+		 | s1 | s2 | endl;
+	sout | endl;
+	sepSet( sout, " " );
+
+	sout
+		// opening delimiters
+		| "v(" | 27
+		| "v[" | 27
+		| "v{" | 27
+		| "$" | 27
+		| "£" | 27
+		| "¥" | 27
+		| "¡" | 27
+		| "¿" | 27
+		| "«" | 27
+		| endl
+		// closing delimiters
+		| 25 | ","
+		| 25 | "."
+		| 25 | ":"
+		| 25 | ";"
+		| 25 | "!"
+		| 25 | "?"
+		| 25 | ")"
+		| 25 | "]"
+		| 25 | "}"
+		| 25 | "%"
+		| 25 | "¢"
+		| 25 | "»"
+		| endl
+		// opening-closing delimiters
+		| 25 | "'" | 27
+		| 25 | "`" | 27
+		| 25 | "\"" | 27
+		| 25 | " " | 27
+		| 25 | "\f" | 27
+		| 25 | "\n" | 27
+		| 25 | "\r" | 27
+		| 25 | "\t" | 27
+		| 25 | "\v" | 27
+		| endl;
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa io.c" //
+// End: //
Index: src/tests/io.data
===================================================================
--- src/tests/io.data	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
+++ src/tests/io.data	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
@@ -0,0 +1,1 @@
+A 1 2 3 4 5 6 7 8 1.1 1.2 1.3 1.1+2.3 1.1-2.3 1.1-2.3 abc xyz
Index: src/tests/limits.c
===================================================================
--- src/tests/limits.c	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
+++ src/tests/limits.c	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
@@ -0,0 +1,114 @@
+//
+// 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.
+//
+// limits.c -- 
+//
+// Author           : Peter A. Buhr
+// Created On       : Tue May 10 20:44:20 2016
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Tue May 10 20:45:28 2016
+// Update Count     : 1
+// 
+
+#include <limits>
+
+// 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 limits.c" //
+// End: //
Index: src/tests/math.c
===================================================================
--- src/tests/math.c	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
+++ src/tests/math.c	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
@@ -0,0 +1,144 @@
+// 
+// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+// 
+// math.c -- 
+// 
+// Author           : Peter A. Buhr
+// Created On       : Fri Apr 22 14:59:21 2016
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun Apr 24 13:24:20 2016
+// Update Count     : 70
+// 
+
+#include <fstream>
+#include <math>
+
+int main( void ) {
+	float f;
+	double d;
+	long double l;
+
+	sout | "fabs:" | fabs( -1.0F ) | fabs( -1.0D ) | fabs( -1.0L ) | cabs( -1.0F+1.0FI ) | cabs( -1.0D+1.0DI ) | cabs( -1.0DL+1.0LI ) | endl;
+	sout | "fmod:" | 5.0F % -2.0F | fmod( 5.0F, -2.0F ) | 5.0D % -2.0D | fmod( 5.0D, -2.0D ) | 5.0L % -2.0L | fmod( 5.0L, -2.0L ) | endl;
+	sout | "remainder:" | remainder( 2.0F, 3.0F ) | remainder( 2.0D, 3.0D ) | remainder( 2.0L, 3.0L ) | endl;
+	int quot;
+	f = remquo( 3.6F, 0.5F, &quot );
+	sout | "remquo:" | quot | f;
+	d = remquo( 3.6D, 0.5F, &quot );
+	sout | quot | d;
+	l = remquo( 3.6L, 0.5L, &quot );
+	sout | quot | l | endl;
+	f = div( 3.6F, 0.5F, &quot );
+	sout | "div:" | quot | f;
+	d = div( 3.6D, 0.5F, &quot );
+	sout | quot | d;
+	l = div( 3.6L, 0.5L, &quot );
+	sout | quot | l | endl;
+	sout | "fma:" | fma( 3.0F, -1.0F, 1.0F ) | fma( 3.0D, -1.0D, 1.0D ) | fma( 3.0L, -1.0L, , 1.0L ) | endl;
+	sout | "fdim:" | fdim( 1.0F, -1.0F ) | fdim( 1.0D, -1.0D ) | fdim( 1.0L, -1.0L ) | endl;
+	sout | "nan:" | (float)nan( "" ) | (double)nan( "" ) | (long double)nan( "" ) | endl;
+
+	//---------------------- Exponential ----------------------
+
+	sout | "exp:" | exp( 1.0F ) | exp( 1.0D ) | exp( 1.0L ) | exp( 1.0F+1.0FI ) | exp( 1.0D+1.0DI ) | exp( 1.0DL+1.0LI ) | endl;
+	sout | "exp2:" | exp2( 1.0F ) | exp2( 1.0D ) | exp2( 1.0L ) | endl;
+	sout | "expm1:" | expm1( 1.0F ) | expm1( 1.0D ) | expm1( 1.0L ) | endl;
+	sout | "log:" | log( 1.0F ) | log( 1.0D ) | log( 1.0L ) | log( 1.0F+1.0FI ) | log( 1.0D+1.0DI ) | log( 1.0DL+1.0LI ) | endl;
+	sout | "log2:" | log2( 8.0F ) | log2( 8.0D ) | log2( 8.0L ) | endl;
+	sout | "log10:" | log10( 100.0F ) | log10( 100.0D ) | log10( 100.0L ) | endl;
+	sout | "log1p:" | log1p( 1.0F ) | log1p( 1.0D ) | log1p( 1.0L ) | endl;
+	sout | "ilogb:" | ilogb( 1.0F ) | ilogb( 1.0D ) | ilogb( 1.0L ) | endl;
+	sout | "logb:" | logb( 8.0F ) | logb( 8.0D ) | logb( 8.0L ) | endl;
+
+	//---------------------- Power ----------------------
+
+	sout | "sqrt:" | sqrt( 1.0F ) | sqrt( 1.0D ) | sqrt( 1.0L ) | sqrt( 1.0F+1.0FI ) | sqrt( 1.0D+1.0DI ) | sqrt( 1.0DL+1.0LI ) | endl;
+	sout | "cbrt:" | cbrt( 27.0F ) | cbrt( 27.0D ) | cbrt( 27.0L ) | endl;
+	sout | "hypot:" | hypot( 1.0F, -1.0F ) | hypot( 1.0D, -1.0D ) | hypot( 1.0L, -1.0L ) | endl;
+	sout | "pow:" | pow( 1.0F, 1.0F ) | pow( 1.0D, 1.0D ) | pow( 1.0L, 1.0L ) | pow( 1.0F+1.0FI, 1.0F+1.0FI ) | pow( 1.0D+1.0DI, 1.0D+1.0DI ) | pow( 1.0DL+1.0LI, 1.0DL+1.0LI ) | endl;
+
+	//---------------------- Trigonometric ----------------------
+
+	sout | "sin:" | sin( 1.0F ) | sin( 1.0D ) | sin( 1.0L ) | sin( 1.0F+1.0FI ) | sin( 1.0D+1.0DI ) | sin( 1.0DL+1.0LI ) | endl;
+	sout | "cos:" | cos( 1.0F ) | cos( 1.0D ) | cos( 1.0L ) | cos( 1.0F+1.0FI ) | cos( 1.0D+1.0DI ) | cos( 1.0DL+1.0LI ) | endl;
+	sout | "tan:" | tan( 1.0F ) | tan( 1.0D ) | tan( 1.0L ) | tan( 1.0F+1.0FI ) | tan( 1.0D+1.0DI ) | tan( 1.0DL+1.0LI ) | endl;
+	sout | "asin:" | asin( 1.0F ) | asin( 1.0D ) | asin( 1.0L ) | asin( 1.0F+1.0FI ) | asin( 1.0D+1.0DI ) | asin( 1.0DL+1.0LI ) | endl;
+	sout | "acos:" | acos( 1.0F ) | acos( 1.0D ) | acos( 1.0L ) | acos( 1.0F+1.0FI ) | acos( 1.0D+1.0DI ) | acos( 1.0DL+1.0LI ) | endl;
+	sout | "atan:" | atan( 1.0F ) | atan( 1.0D ) | atan( 1.0L ) | atan( 1.0F+1.0FI ) | atan( 1.0D+1.0DI ) | atan( 1.0DL+1.0LI ) | endl;
+	sout | "atan2:" | atan2( 1.0F, 1.0F ) | atan2( 1.0D, 1.0D ) | atan2( 1.0L, 1.0L );
+	sout | "atan:" | atan( 1.0F, 1.0F ) | atan( 1.0D, 1.0D ) | atan( 1.0L, 1.0L );
+
+	//---------------------- Hyperbolic ----------------------
+
+	sout | "sinh:" | sinh( 1.0F ) | sinh( 1.0D ) | sinh( 1.0L ) | sinh( 1.0F+1.0FI ) | sinh( 1.0D+1.0DI ) | sinh( 1.0DL+1.0LI ) | endl;
+	sout | "cosh:" | cosh( 1.0F ) | cosh( 1.0D ) | cosh( 1.0L ) | cosh( 1.0F+1.0FI ) | cosh( 1.0D+1.0DI ) | cosh( 1.0DL+1.0LI ) | endl;
+	sout | "tanh:" | tanh( 1.0F ) | tanh( 1.0D ) | tanh( 1.0L ) | tanh( 1.0F+1.0FI ) | tanh( 1.0D+1.0DI ) | tanh( 1.0DL+1.0LI ) | endl;
+	sout | "acosh:" | acosh( 1.0F ) | acosh( 1.0D ) | acosh( 1.0L ) | acosh( 1.0F+1.0FI ) | acosh( 1.0D+1.0DI ) | acosh( 1.0DL+1.0LI ) | endl;
+	sout | "asinh:" | asinh( 1.0F ) | asinh( 1.0D ) | asinh( 1.0L ) | asinh( 1.0F+1.0FI ) | asinh( 1.0D+1.0DI ) | asinh( 1.0DL+1.0LI ) | endl;
+	sout | "atanh:" | atanh( 1.0F ) | atanh( 1.0D ) | atanh( 1.0L ) | atanh( 1.0F+1.0FI ) | atanh( 1.0D+1.0DI ) | atanh( 1.0DL+1.0LI ) | endl;
+
+	//---------------------- Error / Gamma ----------------------
+
+	sout | "erf:" | erf( 1.0F ) | erf( 1.0D ) | erf( 1.0L ) | endl;
+	sout | "erfc:" | erfc( 1.0F ) | erfc( 1.0D ) | erfc( 1.0L ) | endl;
+	sout | "lgamma:" | lgamma( 4.0F ) | lgamma( 4.0D ) | lgamma( 4.0L ) | endl;
+	int sign;
+	f = lgamma( 4.0F, &sign );
+	sout | "lgamma:" | f | sign;
+	d = lgamma( 4.0D, &sign );
+	sout | d | sign;
+	l = lgamma( 4.0L, &sign );
+	sout | l | sign | endl;
+	sout | "tgamma:" | tgamma( 4.0F ) | tgamma( 4.0D ) | tgamma( 4.0L ) | endl;
+
+	//---------------------- Nearest Integer ----------------------
+
+	sout | "floor:" | floor( 1.2F ) | floor( 1.2D ) | floor( 1.2L ) | endl;
+	sout | "ceil:" | ceil( 1.6F ) | ceil( 1.6D ) | ceil( 1.6L ) | endl;
+	sout | "trunc:" | trunc( 3.5F ) | trunc( 3.5D ) | trunc( 3.5L ) | endl;
+	sout | "rint:" | (float)rint( 1.5F ) | (double)rint( 1.5D ) | (long double)rint( 1.5L ) | endl;
+	sout | "rint:" | (long int)rint( 1.5F ) | (long int)rint( 1.5D ) | (long int)rint( 1.5L ) | endl;
+	sout | "rint:" | (long long int)rint( 1.5F ) | (long long int)rint( 1.5D ) | (long long int)rint( 1.5L ) | endl;
+	sout | "lrint:" | lrint( 1.5F ) | lrint( 1.5D ) | lrint( 1.5L ) | endl;
+	sout | "llrint:" | llrint( 1.5F ) | llrint( 1.5D ) | llrint( 1.5L ) | endl;
+	sout | "nearbyint:" | nearbyint( 3.5F ) | nearbyint( 3.5D ) | nearbyint( 3.5L ) | endl;
+	sout | "round:" | (float)round( 1.5F ) | (double)round( 1.5D ) | (long double)round( 1.5L ) | endl;
+	sout | "round:" | (long int)round( 1.5F ) | (long int)round( 1.5D ) | (long int)round( 1.5L ) | endl;
+	sout | "round:" | (long long int)round( 1.5F ) | (long long int)round( 1.5D ) | (long long int)round( 1.5L ) | endl;
+	sout | "lround:" | lround( 1.5F ) | lround( 1.5D ) | lround( 1.5L ) | endl;
+	sout | "llround:" | llround( 1.5F ) | llround( 1.5D ) | llround( 1.5L ) | endl;
+
+	//---------------------- Manipulation ----------------------
+
+	sout | "copysign:" | copysign( 1.0F, -1.0F ) | copysign( 1.0D, -1.0D ) | copysign( 1.0L, -1.0L ) | endl;
+	int exp;
+	f = frexp( 4.0F, &exp );
+	sout | "frexp:" | f | exp;
+	d = frexp( 4.0D, &exp );
+	sout | d | exp;
+	l = frexp( 4.0L, &exp );
+	sout | l | exp | endl;
+	sout | "ldexp:" | ldexp( 2.0F, 2 ) | ldexp( 2.0D, 2 ) | ldexp( 2.0L, 2 ) | endl;
+	float fi;
+	double di;
+	long double ldi;
+	f = modf( 2.3F, &fi );
+	sout | "modf:" | fi | f;
+	d = modf( 2.3D, &di );
+	sout | di | d;
+	l = modf( 2.3L, &ldi );
+	sout | ldi | l;
+	sout | "nextafter:" | nextafter( 2.0F, 3.0F ) | nextafter( 2.0D, 3.0D ) | nextafter( 2.0L, 3.0L ) | endl;
+	sout | "nexttoward:" | nexttoward( 2.0F, 3.0F ) | nexttoward( 2.0D, 3.0D ) | nexttoward( 2.0L, 3.0L ) | endl;
+
+	sout | "scalbn:" | scalbn( 2.0F, 3 ) | scalbn( 2.0D, 3 ) | scalbn( 2.0L, 3 ) | endl;
+	sout | "scalbln:" | scalbln( 2.0F, 3L ) | scalbln( 2.0D, 3L ) | scalbln( 2.0L, 3L ) | endl;
+} // main
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa math.c" //
+// End: //
Index: src/tests/minmax.c
===================================================================
--- src/tests/minmax.c	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
+++ src/tests/minmax.c	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
@@ -0,0 +1,52 @@
+//
+// 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.
+//
+// minmax.c -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Wed May 27 17:56:53 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Mon Feb 29 23:45:16 2016
+// Update Count     : 49
+//
+
+#include <fstream>
+#include <stdlib>										// min, max
+
+int main( void ) {
+	// 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/tests/swap.c
===================================================================
--- src/tests/swap.c	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
+++ src/tests/swap.c	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
@@ -0,0 +1,95 @@
+//
+// 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.
+//
+// swap.c -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Wed May 27 17:56:53 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Thu Apr 21 08:10:41 2016
+// Update Count     : 69
+//
+
+#include <fstream>
+#include <stdlib>										// swap
+
+int main( void ) {
+	char c1 = 'a', c2 = 'b';
+	sout | "char\t\t\t" | c1 | ' ' | c2 | "\t\t\tswap ";
+	swap( &c1, &c2 );
+	sout | '\t' | c1 | ' ' | c2 | endl;
+
+	signed int i1 = -1, i2 = -2;
+	sout | "signed int\t\t" | i1 | i2 | "\t\t\tswap ";
+	swap( &i1, &i2 );
+	sout | '\t' | i1 | i2 | endl;
+
+	unsigned int ui1 = 1, ui2 = 2;
+	sout | "unsigned int\t\t" | ui1 | ui2 | "\t\t\tswap ";
+	swap( &ui1, &ui2 );
+	sout | '\t' | ui1 | ui2 | endl;
+
+	signed long int li1 = -1, li2 = -2;
+	sout | "signed long int\t\t" | li1 | li2 | "\t\t\tswap ";
+	swap( &li1, &li2 );
+	sout | '\t' | li1 | li2 | endl;
+
+	unsigned long int uli1 = 1, uli2 = 2;
+	sout | "unsigned long int\t" | uli1 | uli2 | "\t\t\tswap ";
+	swap( &uli1, &uli2 );
+	sout | '\t' | uli1 | uli2 | endl;
+
+	signed long long int lli1 = -1, lli2 = -2;
+	sout | "signed long long int\t" | lli1 | lli2 | "\t\t\tswap ";
+	swap( &lli1, &lli2 );
+	sout | '\t' | lli1 | lli2 | endl;
+
+	unsigned long long int ulli1 = 1, ulli2 = 2;
+	sout | "unsigned long long int\t" | ulli1 | ulli2 | "\t\t\tswap ";
+	swap( &ulli1, &ulli2 );
+	sout | '\t' | ulli1 | ulli2 | endl;
+
+	float f1 = 1.5, f2 = 2.5;
+	sout | "float\t\t\t" | f1 | f2 | "\t\t\tswap ";
+	swap( &f1, &f2 );
+	sout | '\t' | f1 | f2 | endl;
+
+	double d1 = 1.5, d2 = 2.5;
+	sout | "double\t\t\t" | d1 | d2 | "\t\t\tswap ";
+	swap( &d1, &d2 );
+	sout | '\t' | d1 | d2 | endl;
+
+	long double ld1 = 1.5, ld2 = 2.5;
+	sout | "long double\t\t" | ld1 | ld2 | "\t\t\tswap ";
+	swap( &ld1, &ld2 );
+	sout | '\t' | ld1 | ld2 | endl;
+
+	float _Complex fc1 = 1.5f+1.5if, fc2 = 2.5f+2.5if;
+	sout | "float _Complex\t\t" | fc1 | fc2 | "\tswap ";
+	swap( &fc1, &fc2 );
+	sout | '\t' | fc1 | fc2 | endl;
+
+	double _Complex dc1 = 1.5d+1.5id, dc2 = 2.5d+2.5id;
+	sout | "double _Complex\t\t" | dc1 | dc2 | "\tswap ";
+	swap( &dc1, &dc2 );
+	sout | '\t' | dc1 | dc2 | endl;
+
+	long double _Complex ldc1 = 1.5d+1.5il, ldc2 = 2.5d+2.5il;
+	sout | "long double _Complex\t" | ldc1 | ldc2 | "\tswap ";
+	swap( &ldc1, &ldc2 );
+	sout | '\t' | ldc1 | ldc2 | endl;
+
+	struct S { int i, j; } s1 = { 1, 2 }, s2 = { 2, 1 };
+	ofstream * ?|?( ofstream * os, S s ) { return os | s.i | s.j; }
+	sout | "struct S\t\t" | s1 | "," | s2 | "\t\tswap ";
+	swap( &s1, &s2 );
+	sout | '\t' | s1 | "," | s2 | endl;
+} // main
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa swap.c" //
+// End: //
Index: src/tests/tests/avl_test.make.txt
===================================================================
--- src/tests/tests/avl_test.make.txt	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
+++ src/tests/tests/avl_test.make.txt	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
@@ -0,0 +1,1 @@
+make: *** No rule to make target `avl_test'.  Stop.
Index: src/tests/tests/avl_test.out.txt
===================================================================
--- src/tests/tests/avl_test.out.txt	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
+++ src/tests/tests/avl_test.out.txt	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
@@ -0,0 +1,3 @@
+3 13 0
+foo bar baz
+world bar cheese
Index: src/tests/tests/log.txt
===================================================================
--- src/tests/tests/log.txt	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
+++ src/tests/tests/log.txt	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
@@ -0,0 +1,305 @@
+    vector_test	FAILED with build error:
+cc     vector_test.c   -o vector_test
+In file included from /usr/local/include/iostream:19:0,
+                 from /usr/local/include/fstream:19,
+                 from vector_test.c:16:
+/usr/local/include/iterator:20:1: error: unknown type name 'trait'
+ trait iterator( otype iterator_type, otype elt_type ) {
+ ^
+/usr/local/include/iterator:20:17: error: unknown type name 'otype'
+ trait iterator( otype iterator_type, otype elt_type ) {
+                 ^
+/usr/local/include/iterator:20:38: error: unknown type name 'otype'
+ trait iterator( otype iterator_type, otype elt_type ) {
+                                      ^
+/usr/local/include/iterator:34:1: error: unknown type name 'trait'
+ trait iterator_for( otype iterator_type, otype collection_type, otype elt_type | iterator( iterator_type, elt_type ) ) {
+ ^
+/usr/local/include/iterator:34:21: error: unknown type name 'otype'
+ trait iterator_for( otype iterator_type, otype collection_type, otype elt_type | iterator( iterator_type, elt_type ) ) {
+                     ^
+/usr/local/include/iterator:34:42: error: unknown type name 'otype'
+ trait iterator_for( otype iterator_type, otype collection_type, otype elt_type | iterator( iterator_type, elt_type ) ) {
+                                          ^
+/usr/local/include/iterator:34:65: error: unknown type name 'otype'
+ trait iterator_for( otype iterator_type, otype collection_type, otype elt_type | iterator( iterator_type, elt_type ) ) {
+                                                                 ^
+/usr/local/include/iterator:40:9: error: unknown type name 'otype'
+ forall( otype iterator_type, otype elt_type | iterator( iterator_type, elt_type ) )
+         ^
+/usr/local/include/iterator:40:30: error: unknown type name 'otype'
+ forall( otype iterator_type, otype elt_type | iterator( iterator_type, elt_type ) )
+                              ^
+/usr/local/include/iterator:43:9: error: unknown type name 'otype'
+ forall( otype iterator_type, otype elt_type | iterator( iterator_type, elt_type ) )
+         ^
+/usr/local/include/iterator:43:30: error: unknown type name 'otype'
+ forall( otype iterator_type, otype elt_type | iterator( iterator_type, elt_type ) )
+                              ^
+In file included from /usr/local/include/fstream:19:0,
+                 from vector_test.c:16:
+/usr/local/include/iostream:21:1: error: unknown type name 'trait'
+ trait ostream( dtype ostype ) {
+ ^
+/usr/local/include/iostream:21:16: error: unknown type name 'dtype'
+ trait ostream( dtype ostype ) {
+                ^
+/usr/local/include/iostream:40:1: error: unknown type name 'trait'
+ trait writeable( otype T ) {
+ ^
+/usr/local/include/iostream:40:18: error: unknown type name 'otype'
+ trait writeable( otype T ) {
+                  ^
+/usr/local/include/iostream:46:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, char );
+         ^
+/usr/local/include/iostream:48:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, short int );
+         ^
+/usr/local/include/iostream:49:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, unsigned short int );
+         ^
+/usr/local/include/iostream:50:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, int );
+         ^
+/usr/local/include/iostream:51:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, unsigned int );
+         ^
+/usr/local/include/iostream:52:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, long int );
+         ^
+/usr/local/include/iostream:53:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, long long int );
+         ^
+/usr/local/include/iostream:54:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, unsigned long int );
+         ^
+/usr/local/include/iostream:55:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, unsigned long long int );
+         ^
+/usr/local/include/iostream:57:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, float ); // FIX ME: should not be required
+         ^
+/usr/local/include/iostream:58:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, double );
+         ^
+/usr/local/include/iostream:59:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, long double );
+         ^
+/usr/local/include/iostream:61:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, float _Complex );
+         ^
+/usr/local/include/iostream:62:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, double _Complex );
+         ^
+/usr/local/include/iostream:63:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, long double _Complex );
+         ^
+/usr/local/include/iostream:65:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, const char * );
+         ^
+/usr/local/include/iostream:66:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, const void * );
+         ^
+/usr/local/include/iostream:68:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, ostype * (*)( ostype * ) );
+         ^
+/usr/local/include/iostream:69:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * endl( ostype * );
+         ^
+/usr/local/include/iostream:70:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * sepOn( ostype * );
+         ^
+/usr/local/include/iostream:71:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * sepOff( ostype * );
+         ^
+/usr/local/include/iostream:72:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * sepDisable( ostype * );
+         ^
+/usr/local/include/iostream:73:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * sepEnable( ostype * );
+         ^
+/usr/local/include/iostream:76:9: error: unknown type name 'otype'
+ forall( otype elt_type | writeable( elt_type ), otype iterator_type | iterator( iterator_type, elt_type ), dtype os_type | ostream( os_type ) )
+         ^
+/usr/local/include/iostream:76:49: error: unknown type name 'otype'
+ forall( otype elt_type | writeable( elt_type ), otype iterator_type | iterator( iterator_type, elt_type ), dtype os_type | ostream( os_type ) )
+                                                 ^
+/usr/local/include/iostream:76:108: error: unknown type name 'dtype'
+ forall( otype elt_type | writeable( elt_type ), otype iterator_type | iterator( iterator_type, elt_type ), dtype os_type | ostream( os_type ) )
+                                                                                                            ^
+In file included from /usr/local/include/fstream:19:0,
+                 from vector_test.c:16:
+/usr/local/include/iostream:79:9: error: unknown type name 'otype'
+ forall( otype elt_type | writeable( elt_type ), otype iterator_type | iterator( iterator_type, elt_type ), dtype os_type | ostream( os_type ) )
+         ^
+/usr/local/include/iostream:79:49: error: unknown type name 'otype'
+ forall( otype elt_type | writeable( elt_type ), otype iterator_type | iterator( iterator_type, elt_type ), dtype os_type | ostream( os_type ) )
+                                                 ^
+/usr/local/include/iostream:79:108: error: unknown type name 'dtype'
+ forall( otype elt_type | writeable( elt_type ), otype iterator_type | iterator( iterator_type, elt_type ), dtype os_type | ostream( os_type ) )
+                                                                                                            ^
+/usr/local/include/iostream:84:1: error: unknown type name 'trait'
+ trait istream( dtype istype ) {
+ ^
+/usr/local/include/iostream:84:16: error: unknown type name 'dtype'
+ trait istream( dtype istype ) {
+                ^
+/usr/local/include/iostream:94:1: error: unknown type name 'trait'
+ trait readable( otype T ) {
+ ^
+/usr/local/include/iostream:94:17: error: unknown type name 'otype'
+ trait readable( otype T ) {
+                 ^
+/usr/local/include/iostream:98:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, char * );
+         ^
+/usr/local/include/iostream:100:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, short int * );
+         ^
+/usr/local/include/iostream:101:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, unsigned short int * );
+         ^
+/usr/local/include/iostream:102:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, int * );
+         ^
+/usr/local/include/iostream:103:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, unsigned int * );
+         ^
+/usr/local/include/iostream:104:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, long int * );
+         ^
+/usr/local/include/iostream:105:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, long long int * );
+         ^
+/usr/local/include/iostream:106:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, unsigned long int * );
+         ^
+/usr/local/include/iostream:107:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, unsigned long long int * );
+         ^
+/usr/local/include/iostream:109:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, float * );
+         ^
+/usr/local/include/iostream:110:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, double * );
+         ^
+/usr/local/include/iostream:111:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, long double * );
+         ^
+/usr/local/include/iostream:113:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, float _Complex * );
+         ^
+/usr/local/include/iostream:114:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, double _Complex * );
+         ^
+/usr/local/include/iostream:115:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, long double _Complex * );
+         ^
+/usr/local/include/iostream:118:1: error: unknown type name '_Istream_cstrUC'
+ _Istream_cstrUC cstr( char * );
+ ^
+/usr/local/include/iostream:119:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, _Istream_cstrUC );
+         ^
+/usr/local/include/iostream:122:1: error: unknown type name '_Istream_cstrC'
+ _Istream_cstrC cstr( char *, int size );
+ ^
+/usr/local/include/iostream:122:16: error: conflicting types for 'cstr'
+ _Istream_cstrC cstr( char *, int size );
+                ^
+/usr/local/include/iostream:118:17: note: previous declaration of 'cstr' was here
+ _Istream_cstrUC cstr( char * );
+                 ^
+/usr/local/include/iostream:123:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, _Istream_cstrC );
+         ^
+In file included from vector_test.c:16:0:
+/usr/local/include/fstream:29:15: error: unknown type name 'ofstream'
+ _Bool sepPrt( ofstream * );
+               ^
+/usr/local/include/fstream:30:13: error: unknown type name 'ofstream'
+ void sepOn( ofstream * );
+             ^
+/usr/local/include/fstream:31:14: error: unknown type name 'ofstream'
+ void sepOff( ofstream * );
+              ^
+/usr/local/include/fstream:32:16: error: unknown type name 'ofstream'
+ void sepReset( ofstream * );
+                ^
+/usr/local/include/fstream:33:16: error: unknown type name 'ofstream'
+ void sepReset( ofstream *, _Bool );
+                ^
+/usr/local/include/fstream:34:14: error: unknown type name 'ofstream'
+ void sepSet( ofstream *, const char * );
+              ^
+/usr/local/include/fstream:35:22: error: unknown type name 'ofstream'
+ const char * sepGet( ofstream * );
+                      ^
+/usr/local/include/fstream:36:19: error: unknown type name 'ofstream'
+ _Bool sepDisable( ofstream * );
+                   ^
+/usr/local/include/fstream:37:18: error: unknown type name 'ofstream'
+ _Bool sepEnable( ofstream * );
+                  ^
+/usr/local/include/fstream:38:11: error: unknown type name 'ofstream'
+ int fail( ofstream * );
+           ^
+/usr/local/include/fstream:39:12: error: unknown type name 'ofstream'
+ int flush( ofstream * );
+            ^
+/usr/local/include/fstream:40:12: error: unknown type name 'ofstream'
+ void open( ofstream *, const char * name, const char * mode );
+            ^
+/usr/local/include/fstream:41:13: error: unknown type name 'ofstream'
+ void close( ofstream * );
+             ^
+/usr/local/include/fstream:42:1: error: unknown type name 'ofstream'
+ ofstream * write( ofstream *, const char * data, unsigned long int size );
+ ^
+/usr/local/include/fstream:42:19: error: unknown type name 'ofstream'
+ ofstream * write( ofstream *, const char * data, unsigned long int size );
+                   ^
+/usr/local/include/fstream:43:13: error: unknown type name 'ofstream'
+ int prtfmt( ofstream *, const char fmt[], ... );
+             ^
+/usr/local/include/fstream:45:1: error: unknown type name 'ofstream'
+ extern ofstream * sout, * serr;
+ ^
+/usr/local/include/fstream:52:11: error: unknown type name 'ifstream'
+ int fail( ifstream * is );
+           ^
+/usr/local/include/fstream:53:10: error: unknown type name 'ifstream'
+ int eof( ifstream * is );
+          ^
+/usr/local/include/fstream:54:12: error: unknown type name 'ifstream'
+ void open( ifstream * is, const char * name, const char * mode );
+            ^
+/usr/local/include/fstream:55:13: error: unknown type name 'ifstream'
+ void close( ifstream * is );
+             ^
+/usr/local/include/fstream:56:1: error: unknown type name 'ifstream'
+ ifstream * read( ifstream * is, char * data, unsigned long int size );
+ ^
+/usr/local/include/fstream:56:18: error: unknown type name 'ifstream'
+ ifstream * read( ifstream * is, char * data, unsigned long int size );
+                  ^
+/usr/local/include/fstream:57:1: error: unknown type name 'ifstream'
+ ifstream * ungetc( ifstream * is, char c );
+ ^
+/usr/local/include/fstream:57:20: error: unknown type name 'ifstream'
+ ifstream * ungetc( ifstream * is, char c );
+                    ^
+/usr/local/include/fstream:58:14: error: unknown type name 'ifstream'
+ int scanfmt( ifstream *, const char fmt[], ... );
+              ^
+/usr/local/include/fstream:60:1: error: unknown type name 'ifstream'
+ extern ifstream *sin;
+ ^
+vector_test.c:18:24: fatal error: vector_int.h: No such file or directory
+ #include "vector_int.h"
+                        ^
+compilation terminated.
+make: *** [vector_test] Error 1
+    avl_test	FAILED with build error:
+make: *** No rule to make target `avl_test'.  Stop.
Index: src/tests/tests/vector_test.in.txt
===================================================================
--- src/tests/tests/vector_test.in.txt	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
+++ src/tests/tests/vector_test.in.txt	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
@@ -0,0 +1,1 @@
+1 2 3 4 5
Index: src/tests/tests/vector_test.make.txt
===================================================================
--- src/tests/tests/vector_test.make.txt	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
+++ src/tests/tests/vector_test.make.txt	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
@@ -0,0 +1,302 @@
+cc     vector_test.c   -o vector_test
+In file included from /usr/local/include/iostream:19:0,
+                 from /usr/local/include/fstream:19,
+                 from vector_test.c:16:
+/usr/local/include/iterator:20:1: error: unknown type name 'trait'
+ trait iterator( otype iterator_type, otype elt_type ) {
+ ^
+/usr/local/include/iterator:20:17: error: unknown type name 'otype'
+ trait iterator( otype iterator_type, otype elt_type ) {
+                 ^
+/usr/local/include/iterator:20:38: error: unknown type name 'otype'
+ trait iterator( otype iterator_type, otype elt_type ) {
+                                      ^
+/usr/local/include/iterator:34:1: error: unknown type name 'trait'
+ trait iterator_for( otype iterator_type, otype collection_type, otype elt_type | iterator( iterator_type, elt_type ) ) {
+ ^
+/usr/local/include/iterator:34:21: error: unknown type name 'otype'
+ trait iterator_for( otype iterator_type, otype collection_type, otype elt_type | iterator( iterator_type, elt_type ) ) {
+                     ^
+/usr/local/include/iterator:34:42: error: unknown type name 'otype'
+ trait iterator_for( otype iterator_type, otype collection_type, otype elt_type | iterator( iterator_type, elt_type ) ) {
+                                          ^
+/usr/local/include/iterator:34:65: error: unknown type name 'otype'
+ trait iterator_for( otype iterator_type, otype collection_type, otype elt_type | iterator( iterator_type, elt_type ) ) {
+                                                                 ^
+/usr/local/include/iterator:40:9: error: unknown type name 'otype'
+ forall( otype iterator_type, otype elt_type | iterator( iterator_type, elt_type ) )
+         ^
+/usr/local/include/iterator:40:30: error: unknown type name 'otype'
+ forall( otype iterator_type, otype elt_type | iterator( iterator_type, elt_type ) )
+                              ^
+/usr/local/include/iterator:43:9: error: unknown type name 'otype'
+ forall( otype iterator_type, otype elt_type | iterator( iterator_type, elt_type ) )
+         ^
+/usr/local/include/iterator:43:30: error: unknown type name 'otype'
+ forall( otype iterator_type, otype elt_type | iterator( iterator_type, elt_type ) )
+                              ^
+In file included from /usr/local/include/fstream:19:0,
+                 from vector_test.c:16:
+/usr/local/include/iostream:21:1: error: unknown type name 'trait'
+ trait ostream( dtype ostype ) {
+ ^
+/usr/local/include/iostream:21:16: error: unknown type name 'dtype'
+ trait ostream( dtype ostype ) {
+                ^
+/usr/local/include/iostream:40:1: error: unknown type name 'trait'
+ trait writeable( otype T ) {
+ ^
+/usr/local/include/iostream:40:18: error: unknown type name 'otype'
+ trait writeable( otype T ) {
+                  ^
+/usr/local/include/iostream:46:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, char );
+         ^
+/usr/local/include/iostream:48:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, short int );
+         ^
+/usr/local/include/iostream:49:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, unsigned short int );
+         ^
+/usr/local/include/iostream:50:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, int );
+         ^
+/usr/local/include/iostream:51:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, unsigned int );
+         ^
+/usr/local/include/iostream:52:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, long int );
+         ^
+/usr/local/include/iostream:53:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, long long int );
+         ^
+/usr/local/include/iostream:54:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, unsigned long int );
+         ^
+/usr/local/include/iostream:55:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, unsigned long long int );
+         ^
+/usr/local/include/iostream:57:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, float ); // FIX ME: should not be required
+         ^
+/usr/local/include/iostream:58:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, double );
+         ^
+/usr/local/include/iostream:59:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, long double );
+         ^
+/usr/local/include/iostream:61:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, float _Complex );
+         ^
+/usr/local/include/iostream:62:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, double _Complex );
+         ^
+/usr/local/include/iostream:63:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, long double _Complex );
+         ^
+/usr/local/include/iostream:65:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, const char * );
+         ^
+/usr/local/include/iostream:66:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, const void * );
+         ^
+/usr/local/include/iostream:68:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, ostype * (*)( ostype * ) );
+         ^
+/usr/local/include/iostream:69:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * endl( ostype * );
+         ^
+/usr/local/include/iostream:70:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * sepOn( ostype * );
+         ^
+/usr/local/include/iostream:71:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * sepOff( ostype * );
+         ^
+/usr/local/include/iostream:72:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * sepDisable( ostype * );
+         ^
+/usr/local/include/iostream:73:9: error: unknown type name 'dtype'
+ forall( dtype ostype | ostream( ostype ) ) ostype * sepEnable( ostype * );
+         ^
+/usr/local/include/iostream:76:9: error: unknown type name 'otype'
+ forall( otype elt_type | writeable( elt_type ), otype iterator_type | iterator( iterator_type, elt_type ), dtype os_type | ostream( os_type ) )
+         ^
+/usr/local/include/iostream:76:49: error: unknown type name 'otype'
+ forall( otype elt_type | writeable( elt_type ), otype iterator_type | iterator( iterator_type, elt_type ), dtype os_type | ostream( os_type ) )
+                                                 ^
+/usr/local/include/iostream:76:108: error: unknown type name 'dtype'
+ forall( otype elt_type | writeable( elt_type ), otype iterator_type | iterator( iterator_type, elt_type ), dtype os_type | ostream( os_type ) )
+                                                                                                            ^
+In file included from /usr/local/include/fstream:19:0,
+                 from vector_test.c:16:
+/usr/local/include/iostream:79:9: error: unknown type name 'otype'
+ forall( otype elt_type | writeable( elt_type ), otype iterator_type | iterator( iterator_type, elt_type ), dtype os_type | ostream( os_type ) )
+         ^
+/usr/local/include/iostream:79:49: error: unknown type name 'otype'
+ forall( otype elt_type | writeable( elt_type ), otype iterator_type | iterator( iterator_type, elt_type ), dtype os_type | ostream( os_type ) )
+                                                 ^
+/usr/local/include/iostream:79:108: error: unknown type name 'dtype'
+ forall( otype elt_type | writeable( elt_type ), otype iterator_type | iterator( iterator_type, elt_type ), dtype os_type | ostream( os_type ) )
+                                                                                                            ^
+/usr/local/include/iostream:84:1: error: unknown type name 'trait'
+ trait istream( dtype istype ) {
+ ^
+/usr/local/include/iostream:84:16: error: unknown type name 'dtype'
+ trait istream( dtype istype ) {
+                ^
+/usr/local/include/iostream:94:1: error: unknown type name 'trait'
+ trait readable( otype T ) {
+ ^
+/usr/local/include/iostream:94:17: error: unknown type name 'otype'
+ trait readable( otype T ) {
+                 ^
+/usr/local/include/iostream:98:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, char * );
+         ^
+/usr/local/include/iostream:100:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, short int * );
+         ^
+/usr/local/include/iostream:101:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, unsigned short int * );
+         ^
+/usr/local/include/iostream:102:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, int * );
+         ^
+/usr/local/include/iostream:103:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, unsigned int * );
+         ^
+/usr/local/include/iostream:104:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, long int * );
+         ^
+/usr/local/include/iostream:105:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, long long int * );
+         ^
+/usr/local/include/iostream:106:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, unsigned long int * );
+         ^
+/usr/local/include/iostream:107:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, unsigned long long int * );
+         ^
+/usr/local/include/iostream:109:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, float * );
+         ^
+/usr/local/include/iostream:110:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, double * );
+         ^
+/usr/local/include/iostream:111:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, long double * );
+         ^
+/usr/local/include/iostream:113:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, float _Complex * );
+         ^
+/usr/local/include/iostream:114:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, double _Complex * );
+         ^
+/usr/local/include/iostream:115:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, long double _Complex * );
+         ^
+/usr/local/include/iostream:118:1: error: unknown type name '_Istream_cstrUC'
+ _Istream_cstrUC cstr( char * );
+ ^
+/usr/local/include/iostream:119:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, _Istream_cstrUC );
+         ^
+/usr/local/include/iostream:122:1: error: unknown type name '_Istream_cstrC'
+ _Istream_cstrC cstr( char *, int size );
+ ^
+/usr/local/include/iostream:122:16: error: conflicting types for 'cstr'
+ _Istream_cstrC cstr( char *, int size );
+                ^
+/usr/local/include/iostream:118:17: note: previous declaration of 'cstr' was here
+ _Istream_cstrUC cstr( char * );
+                 ^
+/usr/local/include/iostream:123:9: error: unknown type name 'dtype'
+ forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, _Istream_cstrC );
+         ^
+In file included from vector_test.c:16:0:
+/usr/local/include/fstream:29:15: error: unknown type name 'ofstream'
+ _Bool sepPrt( ofstream * );
+               ^
+/usr/local/include/fstream:30:13: error: unknown type name 'ofstream'
+ void sepOn( ofstream * );
+             ^
+/usr/local/include/fstream:31:14: error: unknown type name 'ofstream'
+ void sepOff( ofstream * );
+              ^
+/usr/local/include/fstream:32:16: error: unknown type name 'ofstream'
+ void sepReset( ofstream * );
+                ^
+/usr/local/include/fstream:33:16: error: unknown type name 'ofstream'
+ void sepReset( ofstream *, _Bool );
+                ^
+/usr/local/include/fstream:34:14: error: unknown type name 'ofstream'
+ void sepSet( ofstream *, const char * );
+              ^
+/usr/local/include/fstream:35:22: error: unknown type name 'ofstream'
+ const char * sepGet( ofstream * );
+                      ^
+/usr/local/include/fstream:36:19: error: unknown type name 'ofstream'
+ _Bool sepDisable( ofstream * );
+                   ^
+/usr/local/include/fstream:37:18: error: unknown type name 'ofstream'
+ _Bool sepEnable( ofstream * );
+                  ^
+/usr/local/include/fstream:38:11: error: unknown type name 'ofstream'
+ int fail( ofstream * );
+           ^
+/usr/local/include/fstream:39:12: error: unknown type name 'ofstream'
+ int flush( ofstream * );
+            ^
+/usr/local/include/fstream:40:12: error: unknown type name 'ofstream'
+ void open( ofstream *, const char * name, const char * mode );
+            ^
+/usr/local/include/fstream:41:13: error: unknown type name 'ofstream'
+ void close( ofstream * );
+             ^
+/usr/local/include/fstream:42:1: error: unknown type name 'ofstream'
+ ofstream * write( ofstream *, const char * data, unsigned long int size );
+ ^
+/usr/local/include/fstream:42:19: error: unknown type name 'ofstream'
+ ofstream * write( ofstream *, const char * data, unsigned long int size );
+                   ^
+/usr/local/include/fstream:43:13: error: unknown type name 'ofstream'
+ int prtfmt( ofstream *, const char fmt[], ... );
+             ^
+/usr/local/include/fstream:45:1: error: unknown type name 'ofstream'
+ extern ofstream * sout, * serr;
+ ^
+/usr/local/include/fstream:52:11: error: unknown type name 'ifstream'
+ int fail( ifstream * is );
+           ^
+/usr/local/include/fstream:53:10: error: unknown type name 'ifstream'
+ int eof( ifstream * is );
+          ^
+/usr/local/include/fstream:54:12: error: unknown type name 'ifstream'
+ void open( ifstream * is, const char * name, const char * mode );
+            ^
+/usr/local/include/fstream:55:13: error: unknown type name 'ifstream'
+ void close( ifstream * is );
+             ^
+/usr/local/include/fstream:56:1: error: unknown type name 'ifstream'
+ ifstream * read( ifstream * is, char * data, unsigned long int size );
+ ^
+/usr/local/include/fstream:56:18: error: unknown type name 'ifstream'
+ ifstream * read( ifstream * is, char * data, unsigned long int size );
+                  ^
+/usr/local/include/fstream:57:1: error: unknown type name 'ifstream'
+ ifstream * ungetc( ifstream * is, char c );
+ ^
+/usr/local/include/fstream:57:20: error: unknown type name 'ifstream'
+ ifstream * ungetc( ifstream * is, char c );
+                    ^
+/usr/local/include/fstream:58:14: error: unknown type name 'ifstream'
+ int scanfmt( ifstream *, const char fmt[], ... );
+              ^
+/usr/local/include/fstream:60:1: error: unknown type name 'ifstream'
+ extern ifstream *sin;
+ ^
+vector_test.c:18:24: fatal error: vector_int.h: No such file or directory
+ #include "vector_int.h"
+                        ^
+compilation terminated.
+make: *** [vector_test] Error 1
Index: src/tests/tests/vector_test.out.txt
===================================================================
--- src/tests/tests/vector_test.out.txt	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
+++ src/tests/tests/vector_test.out.txt	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
@@ -0,0 +1,5 @@
+enter N elements and C-d on a separate line:
+Array elements:
+1 2 3 4 5
+Array elements reversed:
+5 4 3 2 1
Index: src/tests/vector_int.h
===================================================================
--- src/tests/vector_int.h	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
+++ src/tests/vector_int.h	(revision 3dcd347a4c5f8c100391138bbb76f5e1368092a1)
@@ -0,0 +1,45 @@
+//
+// 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.
+//
+// vector_int.h --
+//
+// Author           : Richard C. Bilson
+// Created On       : Wed May 27 17:56:53 2015
+// Last Modified By : Rob Schluntz
+// Last Modified On : Wed Apr 27 17:26:59 2016
+// Update Count     : 2
+//
+
+#ifndef VECTOR_INT_H
+#define VECTOR_INT_H
+
+// A flexible array, similar to a C++ vector, that holds integers and can be resized dynamically
+
+typedef struct vector_int {
+	int last;											// last used index
+	int capacity;										// last possible index before reallocation
+	int *data;											// array
+} vector_int;
+
+void ?{}( vector_int * );								// allocate vector with default capacity
+void ?{}( vector_int *, int reserve );          // allocate vector with specified capacity
+void ?{}( vector_int * vec, vector_int other ); // copy constructor
+void ^?{}( vector_int * );								// deallocate vector's storage
+
+void reserve( vector_int *vec, int reserve );			// reserve more capacity
+void append( vector_int *vec, int element );			// add element to end of vector, resizing as necessary
+
+// implement bounded_array
+
+lvalue int ?[?]( vector_int * vec, int index );			// access to arbitrary element (does not resize)
+int last( vector_int * vec );								// return last element
+
+#endif // VECTOR_INT_H
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa vector_int.c" //
+// End: //
