Index: benchmark/readyQ/cycle.go
===================================================================
--- benchmark/readyQ/cycle.go	(revision 13898103d95655f9105ab4f220516ac97d1cb04e)
+++ benchmark/readyQ/cycle.go	(revision 88a0ff6bf6d60cf5f082063e77f79648c618f122)
@@ -14,5 +14,8 @@
 	for true {
 		<- mine
-		next <- 0
+		select {
+		case next <- 0:
+		default:
+		}
 		count += 1
 		if  clock_mode && atomic.LoadInt32(&stop) == 1 { break }
Index: doc/theses/andrew_beach_MMath/Makefile
===================================================================
--- doc/theses/andrew_beach_MMath/Makefile	(revision 13898103d95655f9105ab4f220516ac97d1cb04e)
+++ doc/theses/andrew_beach_MMath/Makefile	(revision 88a0ff6bf6d60cf5f082063e77f79648c618f122)
@@ -31,5 +31,4 @@
 	${GLOSSARY} ${BUILD}/${BASE}
 	${LATEX} ${BASE}
-	${LATEX} ${BASE}
 
 ${DOC}: ${BUILD}/${DOC}
Index: doc/theses/andrew_beach_MMath/cfalab.sty
===================================================================
--- doc/theses/andrew_beach_MMath/cfalab.sty	(revision 13898103d95655f9105ab4f220516ac97d1cb04e)
+++ doc/theses/andrew_beach_MMath/cfalab.sty	(revision 88a0ff6bf6d60cf5f082063e77f79648c618f122)
@@ -27,4 +27,17 @@
 % Cforall with the forall symbol.
 \newsymbolcmd\CFA{\textsf{C}\raisebox{\depth}{\rotatebox{180}{\textsf{A}}}}
+% C++ with kerning. (No standard number support.)
+\newsymbolcmd\CPP{\textrm{C}\kern-.1em\hbox{+\kern-.25em+}}
+
+% This is executed very early in the \begin{document} code.
+\AtEndPreamble{
+  \@ifpackageloaded{hyperref}{
+    % Convert symbols to pdf compatable forms when required.
+    \pdfstringdefDisableCommands{
+      \def\CFA{CFA}
+      \def\CPP{C++}
+    }
+  }{}
+}
 
 % The CFA listings language. Based off of ANCI C and including GCC extensions.
@@ -72,13 +85,3 @@
     \renewcommand\textunderscore{\csuse{cfalab@textunderscore@#1}}}
 
-% This is executed very early in the \begin{document} code.
-\AtEndPreamble{
-  \@ifpackageloaded{hyperref}{
-    % Convert symbols to pdf compatable forms when required.
-    \pdfstringdefDisableCommands{
-      \def\CFA{CFA}
-    }
-  }{}
-}
-
 \endinput
Index: doc/theses/andrew_beach_MMath/existing.tex
===================================================================
--- doc/theses/andrew_beach_MMath/existing.tex	(revision 88a0ff6bf6d60cf5f082063e77f79648c618f122)
+++ doc/theses/andrew_beach_MMath/existing.tex	(revision 88a0ff6bf6d60cf5f082063e77f79648c618f122)
@@ -0,0 +1,237 @@
+\chapter{\CFA{} Existing Features}
+
+\section{Overloading and extern}
+Cforall has overloading, allowing multiple definitions of the same name to
+be defined.
+
+This also adds name mangling so that the assembly symbols are unique for
+different overloads. For compatability with names in C there is also a
+syntax to diable the name mangling. These unmangled names cannot be overloaded
+but act as the interface between C and \CFA code.
+
+The syntax for disabling mangling is:
+\begin{lstlisting}
+extern "C" {
+    ...
+}
+\end{lstlisting}
+
+To re-enable mangling once it is disabled the syntax is:
+\begin{lstlisting}
+extern "Cforall" {
+    ...
+}
+\end{lstlisting}
+
+Both should occur at the declaration level and effect all the declarations
+in \texttt{...}. Neither care about the state of mangling when they begin
+and will return to that state after the group is finished. So re-enabling
+is only used to nest areas of mangled and unmangled declarations.
+
+\section{References}
+\CFA adds references to C. These are auto-dereferencing pointers and use the
+same syntax as pointers except they use ampersand (\codeCFA{\&}) instead of
+the asterisk (\codeCFA{*}). They can also be constaint or mutable, if they
+are mutable they may be assigned to by using the address-of operator
+(\codeCFA\&) which converts them into a pointer.
+
+\section{Constructors and Destructors}
+
+Both constructors and destructors are operators, which means they are just
+functions with special names. The special names are used to define them and
+may be used to call the functions expicately. The \CFA special names are
+constructed by taking the tokens in the operators and putting \texttt{?} where
+the arguments would go. So multiplication is \texttt{?*?} while dereference
+is \texttt{*?}. This also make it easy to tell the difference between
+pre-fix operations (such as \texttt{++?}) and post-fix operations
+(\texttt{?++}).
+
+The special name for contructors is \texttt{?\{\}}, which comes from the
+initialization syntax in C. The special name for destructors is
+\texttt{\^{}?\{\}}. % I don't like the \^{} symbol but $^\wedge$ isn't better.
+
+Any time a type T goes out of scope the destructor matching
+\codeCFA{void ^?\{\}(T \&);} is called. In theory this is also true of
+primitive types such as \codeCFA{int}, but in practice those are no-ops and
+are usually omitted for optimization.
+
+\section{Polymorphism}
+\CFA uses polymorphism to create functions and types that are defined over
+different types. \CFA polymorphic declarations serve the same role as \CPP
+templates or Java generics.
+
+Polymorphic declaractions start with a forall clause that goes before the
+standard (monomorphic) declaration. These declarations have the same syntax
+except that you may use the names introduced by the forall clause in them.
+
+Forall clauses are written \codeCFA{forall( ... )} where \codeCFA{...} becomes
+the list of polymorphic variables (local type names) and assertions, which
+repersent required operations on those types.
+
+\begin{lstlisting}
+forall(dtype T | { void do_once(T &); })
+void do_twice(T & value) {
+    do_once(value);
+    do_once(value);
+}
+\end{lstlisting}
+
+A polymorphic function can be used in the same way normal functions are.
+The polymorphics variables are filled in with concrete types and the
+assertions are checked. An assertion checked by seeing if that name of that
+type (with all the variables replaced with the concrete types) is defined at
+the the call site.
+
+As an example, even if no function named \codeCFA{do\_once} is not defined
+near the definition of \codeCFA{do\_twice} the following code will work.
+\begin{lstlisting}
+int quadruple(int x) {
+    void do_once(int & y) {
+        y = y * 2;
+    }
+    do_twice(x);
+    return x;
+}
+\end{lstlisting}
+This is not the recommended way to implement a quadruple function but it
+does work. The complier will deduce that \codeCFA{do\_twice}'s T is an
+integer from the argument. It will then look for a definition matching the
+assertion which is the \codeCFA{do\_once} defined within the function. That
+function will be passed in as a function pointer to \codeCFA{do\_twice} and
+called within it.
+
+To avoid typing out long lists of assertions again and again there are also
+traits which collect assertions into convenent packages that can then be used
+in assertion lists instead of all of their components.
+\begin{lstlisting}
+trait done_once(dtype T) {
+    void do_once(T &);
+}
+\end{lstlisting}
+
+After this the forall list in the previous example could instead be written
+with the trait instead of the assertion itself.
+\begin{lstlisting}
+forall(dtype T | done_once(T))
+\end{lstlisting}
+
+Traits can have arbitrary number of assertions in them and are usually used to
+create short hands for, and give descriptive names to, commond groupings of
+assertions.
+
+Polymorphic structures and unions may also be defined by putting a forall
+clause before the declaration. The type variables work the same way except
+are now used in field declaractions instead of parameters and local variables.
+
+\begin{lstlisting}
+forall(dtype T)
+struct node {
+    node(T) * next;
+    T * data;
+}
+\end{lstlisting}
+
+The \codeCFA{node(T)} is a use of a polymorphic structure. Polymorphic types
+must be provided their polymorphic parameters.
+
+There are many other features of polymorphism that have not given here but
+these are the ones used by the exception system.
+
+\section{Concurrency}
+
+\CFA has a number of concurrency features, \codeCFA{thread}s,
+\codeCFA{monitor}s and \codeCFA{mutex} parameters, \codeCFA{coroutine}s and
+\codeCFA{generator}s. The two features that interact with the exception system
+are \codeCFA{thread}s and \codeCFA{coroutine}s; they and their supporting
+constructs will be described here.
+
+\subsection{Coroutines}
+Coroutines are routines that do not have to finish execution to hand control
+back to their caller, instead they may suspend their execution at any time
+and resume it later.
+Coroutines are not true concurrency but share some similarities and many of
+the same underpinnings and so are included as part of the \CFA threading
+library.
+
+In \CFA coroutines are created using the \codeCFA{coroutine} keyword which
+works just like \codeCFA{struct} except that the created structure will be
+modified by the compiler to satify the \codeCFA{is\_coroutine} trait.
+
+These structures act as the interface between callers and the coroutine,
+the fields are used to pass information in and out. Here is a simple example
+where the single field is used to pass the next number in a sequence out.
+\begin{lstlisting}
+coroutine CountUp {
+    unsigned int next;
+}
+\end{lstlisting}
+
+The routine part of the coroutine is a main function for the coroutine. It
+takes a reference to a coroutine object and returns nothing. In this function,
+and any functions called by this function, the suspend statement may be used
+to return execution to the coroutine's caller. When control returns to the
+function it continue from that same suspend statement instead of at the top
+of the function.
+\begin{lstlisting}
+void main(CountUp & this) {
+    unsigned int next = 0;
+    while (true) {
+        this.next = next;
+        suspend;
+        next = next + 1;
+    }
+}
+\end{lstlisting}
+
+Control is passed to the coroutine with the resume function. This includes the
+first time when the coroutine is starting up. The resume function takes a
+reference to the coroutine structure and returns the same reference. The
+return value is for easy access to communication variables. For example the
+next value from a count-up can be generated and collected in a single
+expression: \codeCFA{resume(count).next}.
+
+\subsection{Monitors and Mutex}
+
+True concurrency does not garrenty ordering. To get some of that ordering back
+\CFA uses monitors and mutex (mutual exclution) parameters. A monitor is
+another special declaration that contains a lock and is compatable with mutex
+parameters.
+
+Function parameters can have the \codeCFA{mutex} qualifiers on reference
+arguments, for example \codeCFA{void example(a_monitor & mutex arg);}. When the
+function is called it will acquire the lock on all of the mutex parameters.
+
+This means that all functions that mutex on a type are part of a critical
+section and only one will ever run at a time.
+
+\subsection{Threads}
+While coroutines allow new things to be done with a single execution path
+threads actually introduce new paths of execution that continue independently.
+Now for threads to work together their must be some communication between them
+and that means the timing of certain operations does have to be known. There
+or various means of syncronization and mutual exclution provided by \CFA but
+for exceptions only the basic two -- fork and join -- are needed.
+
+Threads are created like coroutines except the keyword is changed:
+\begin{lstlisting}
+thread StringWorker {
+    const char * input;
+    int result;
+};
+
+void main(StringWorker & this) {
+    const char * localCopy = this.input;
+    // ... do some work, perhaps hashing the string ...
+    this.result = result;
+}
+\end{lstlisting}
+The main function will start executing after the fork operation and continue
+executing until it is finished. If another thread joins with this one it will
+wait until main has completed execution. In other words everything the thread
+does is between fork and join.
+
+From the outside this is the creation and destruction of the thread object.
+Fork happens after the constructor is run and join happens before the
+destructor runs. Join also happens during the \codeCFA{join} function which
+can be used to join a thread earlier. If it is used the destructor does not
+join as that has already been completed.
Index: doc/theses/andrew_beach_MMath/thesis.tex
===================================================================
--- doc/theses/andrew_beach_MMath/thesis.tex	(revision 13898103d95655f9105ab4f220516ac97d1cb04e)
+++ doc/theses/andrew_beach_MMath/thesis.tex	(revision 88a0ff6bf6d60cf5f082063e77f79648c618f122)
@@ -50,5 +50,8 @@
 % MAIN BODY
 %----------------------------------------------------------------------
+\input{existing}
+\input{features}
 \input{unwinding}
+\input{future}
 
 %======================================================================
Index: libcfa/src/bits/collection.hfa
===================================================================
--- libcfa/src/bits/collection.hfa	(revision 88a0ff6bf6d60cf5f082063e77f79648c618f122)
+++ libcfa/src/bits/collection.hfa	(revision 88a0ff6bf6d60cf5f082063e77f79648c618f122)
@@ -0,0 +1,57 @@
+#pragma once
+
+struct Colable {
+	Colable * next;										// next node in the list
+	// invariant: (next != 0) <=> listed()
+};
+
+inline {
+	void ?{}( Colable & co ) with( co ) {
+		next = 0p;
+	} // post: ! listed()
+
+	// return true iff *this is an element of a collection
+	bool listed( Colable & co ) with( co ) {			// pre: this != 0
+		return next != 0;
+	}
+
+	Colable * getNext( Colable & co ) with( co ) {
+		return next;
+	}
+
+	Colable *& Next( Colable * cp ) {
+		return cp->next;
+	}
+} // distribution
+
+struct Collection {
+	void * root;										// pointer to root element of list
+};
+
+inline {
+	// class invariant: root == 0 & empty() | *root in *this
+	void ?{}( Collection &, const Collection & ) = void; // no copy
+	Collection & ?=?( const Collection & ) = void;		// no assignment
+
+	void ?{}( Collection & collection ) with( collection ) {	
+		root = 0p;
+	} // post: empty()
+
+	bool empty( Collection & collection ) with( collection ) { // 0 <=> *this contains no elements
+		return root == 0p;
+	}
+	void * head( Collection & collection ) with( collection ) {
+		return root;
+	} // post: empty() & head() == 0 | !empty() & head() in *this
+} // distribution
+
+
+struct ColIter {
+	void * curr;										// element to be returned by >>
+};
+
+inline {
+	void ?{}( ColIter & colIter ) with( colIter ) {
+		curr = 0p;
+	} // post: elts = null
+} // distribution
Index: libcfa/src/bits/queue.hfa
===================================================================
--- libcfa/src/bits/queue.hfa	(revision 88a0ff6bf6d60cf5f082063e77f79648c618f122)
+++ libcfa/src/bits/queue.hfa	(revision 88a0ff6bf6d60cf5f082063e77f79648c618f122)
@@ -0,0 +1,203 @@
+#pragma once
+
+#include "collection.hfa"
+
+forall( dtype T ) {
+	struct Queue {
+		inline Collection;								// Plan 9 inheritance
+		T * last;										// last element, or 0 if queue is empty.
+	};
+
+	inline {
+		// wrappers to make Collection have T
+		T * head( Queue(T) & q ) with( q ) {
+			return (T *)head( (Collection &)q );
+		} // post: empty() & head() == 0 | !empty() & head() in *q
+
+		bool empty( Queue(T) & q ) with( q ) {			// 0 <=> *q contains no elements
+			return empty( (Collection &)q );
+		}
+
+		bool listed( T * n ) {
+			return Next( (Colable *)n ) != 0;
+		}
+
+		T *& Next( T * n ) {
+			return (T *)Next( (Colable *)n );
+		}
+
+		T * Root( Queue(T) & q ) with( q ) {
+			return (T *)root;
+		}
+
+		void ?{}( Queue(T) &, const Queue(T) & ) = void; // no copy
+		Queue(T) & ?=?( const Queue(T) & ) = void;		// no assignment
+
+		void ?{}( Queue(T) & q ) with( q ) {
+			((Collection &)q){};
+			last = 0p;
+		} // post: empty()
+
+		T * tail( Queue(T) & q ) with( q ) {
+			return last;
+		}
+
+		T * succ( Queue(T) & q, T * n ) with( q ) {		// pre: *n in *q
+#ifdef __CFA_DEBUG__
+			if ( ! listed( n ) ) abort( "(Queue &)%p.succ( %p ) : Node is not on a list.", &q, n );
+#endif // __CFA_DEBUG__
+			return (Next( n ) == n) ? 0p : Next( n );
+		} // post: n == tail() & succ(n) == 0 | n != tail() & *succ(n) in *q
+
+		void addHead( Queue(T) & q, T * n ) with( q ) {
+#ifdef __CFA_DEBUG__
+			if ( listed( n ) ) abort( "(Queue &)%p.addHead( %p ) : Node is already on another list.", &q, n );
+#endif // __CFA_DEBUG__
+			if ( last ) {
+				Next( n ) = Root( q );
+				q.root = n;
+			} else {
+				root = last = n;
+				Next( n ) = n;							// last node points to itself
+			}
+		}
+
+		void addTail( Queue(T) & q, T * n ) with( q ) {
+#ifdef __CFA_DEBUG__
+			if ( listed( n ) ) abort( "(Queue &)%p.addTail( %p ) : Node is already on another list.", &q, n );
+#endif // __CFA_DEBUG__
+			if ( last ) Next( last ) = n;
+			else root = n;
+			last = n;
+			Next( n ) = n;								// last node points to itself
+		}
+
+		void add( Queue(T) & q, T * n ) with( q ) {
+			addTail( q, n );
+		}
+
+		T * dropHead( Queue(T) & q ) with( q ) {
+			T * t = head( q );
+			if ( root ) {
+				root = Next( root );
+				if ( Root( q ) == t ) {
+					root = last = 0p;					// only one element
+				}
+				Next( t ) = 0p;
+			}
+			return t;
+		}
+
+		T * drop( Queue(T) & q ) with( q ) {
+			return dropHead( q );
+		}
+
+		void remove( Queue(T) & q, T * n ) with( q ) {	// O(n)
+#ifdef __CFA_DEBUG__
+			if ( ! listed( (Colable &)(*n) ) ) abort( "(Queue &)%p.remove( %p ) : Node is not on a list.", &q, n );
+#endif // __CFA_DEBUG__
+			T * prev = 0;
+			T * curr = (T *)root;
+			for ( ;; ) {
+				if (n == curr) {						// found => remove
+					if ((T *)root == n) {
+						dropHead( q );
+					} else if (last == n) {
+						last = prev;
+						Next( last ) = last;
+					} else {
+						Next( prev ) = Next( curr );
+					}
+					Next( n ) = 0p;
+					break;
+				}
+#ifdef __CFA_DEBUG__
+				// not found => error
+				if (curr == last) abort( "(Queue &)%p.remove( %p ) : Node is not in list.", &q, n );
+#endif // __CFA_DEBUG__
+				prev = curr;
+				curr = Next( curr );
+			}
+		} // post: ! listed( n )
+
+		T * dropTail( Queue(T) & q ) with( q ) { // O(n)
+			T * n = tail( q );
+			return n ? remove( q, n ), n : 0p;
+		}
+
+		// Transfer the "from" list to the end of queue sequence; the "from" list is empty after the transfer.
+		void transfer( Queue(T) & q, Queue(T) & from ) with( q ) {
+			if ( empty( from ) ) return;				// "from" list empty ?
+			if ( empty( q ) ) {							// "to" list empty ?
+				root = from.root;
+			} else {									// "to" list not empty
+				Next( last ) = Root( from );
+			}
+			last = from.last;
+			from.root = from.last = 0p;					// mark "from" list empty
+		}
+
+		// Transfer the "from" list up to node "n" to the end of queue list; the "from" list becomes the list after node "n".
+		// Node "n" must be in the "from" list.
+		void split( Queue(T) & q, Queue(T) & from, T * n ) with( q ) {
+#ifdef __CFA_DEBUG__
+			if ( ! listed( (Colable &)(*n) ) ) abort( "(Queue &)%p.split( %p ) : Node is not on a list.", &q, n );
+#endif // __CFA_DEBUG__
+			Queue(T) to;
+			to.root = from.root;						// start of "to" list
+			to.last = n;								// end of "to" list
+			from.root = Next( n );						// start of "from" list
+			if ( n == Root( from ) ) {					// last node in list ?
+				from.root = from.last = 0p;				// mark "from" list empty
+			} else {
+				Next( n ) = n;							// fix end of "to" list
+			}
+			transfer( q, to );
+		}
+	} // distribution
+} // distribution
+
+forall( dtype T ) {
+	struct QueueIter {
+		inline ColIter;									// Plan 9 inheritance
+	};	
+
+	inline {
+		// wrappers to make ColIter have T
+		T * Curr( QueueIter(T) & qi ) with( qi ) {
+			return (T *)curr;
+		}
+
+		void ?{}( QueueIter(T) & qi ) with( qi ) {
+			((ColIter &)qi){};
+		} // post: curr == 0p
+
+		// create an iterator active in Queue q
+		void ?{}( QueueIter(T) & qi, Queue(T) & q ) with( qi ) {
+			curr = head( q );
+		} // post: curr = {e in q}
+
+		void ?{}( QueueIter(T) & qi, T * start ) with( qi ) {
+			curr = start;
+		} // post: curr = {e in q}
+
+		// make existing iterator active in Queue q
+		void over( QueueIter(T) & qi, Queue(T) & q ) with( qi ) {
+			curr = head( q );
+		} // post: curr = {e in q}
+
+		bool ?>>?( QueueIter(T) & qi, T *& tp ) with( qi ) {
+			if ( curr ) {
+				tp = Curr( qi );
+				T * n = Next( Curr( qi ) );
+				curr = (n == Curr( qi ) ) ? 0p : n;
+			} else tp = 0p;
+			return tp != 0p;
+		}
+		// post: elts == null & !operator>>(tp) | elts != null & *tp' in elts & elts' == elts - *tp & operator>>(tp)
+	} // distribution
+} // distribution
+
+// Local Variables: //
+// compile-command: "make install" //
+// End: //
Index: libcfa/src/bits/queue_example.cfa
===================================================================
--- libcfa/src/bits/queue_example.cfa	(revision 88a0ff6bf6d60cf5f082063e77f79648c618f122)
+++ libcfa/src/bits/queue_example.cfa	(revision 88a0ff6bf6d60cf5f082063e77f79648c618f122)
@@ -0,0 +1,113 @@
+#include <fstream.hfa>
+#include <stdlib.hfa>									// new, delete
+#include "queue.hfa"
+
+int main() {
+	// Fred test
+
+	struct Fred {
+		inline Colable;									// Plan 9 inheritance
+		int i;
+	};
+	void ?{}( Fred & fred ) { abort(); }
+	void ?{}( Fred & fred, int p ) with( fred ) {
+		i = p;
+	}
+
+	Queue(Fred) fred;
+	QueueIter(Fred) fredIter = { fred };
+	Fred * f;
+	int i;
+
+	sout | nlOff;										// turn off auto newline
+
+	for ( ; fredIter >> f; ) {							// empty list
+		sout | f->i | ' ';
+	}
+	sout | "empty" | nl;
+	
+	for ( i = 0; i < 10; i += 1 ) {
+		add( fred, new( 2 * i ) );
+	}
+
+	for ( over( fredIter, fred ); fredIter >> f; ) {
+		sout | f->i | ' ';
+	}
+	sout | nl;
+
+	for ( i = 0; i < 9; i += 1 ) {
+		delete( drop( fred ) );
+	}
+
+	for ( over( fredIter, fred ); fredIter >> f; ) {
+		sout | f->i | ' ';
+	}
+	sout | nl;
+	
+	for ( i = 0; i < 10; i += 1 ) {
+		add( fred, new( 2 * i + 1 ) );
+	}
+	for ( over( fredIter, fred ); fredIter >> f; ) {
+		sout | f->i | ' ';
+	}
+	sout | nl;
+
+	for ( over( fredIter, fred ); fredIter >> f; ) {
+		delete( f );
+	}
+
+	// Mary test
+
+	struct Mary {
+		inline Fred;									// Plan 9 inheritance
+		int j;
+	};
+	void ?{}( Mary & mary ) { abort(); }
+	void ?{}( Mary & mary, int p ) with( mary ) {
+		((Fred &)mary){ p };
+		j = i = p;
+	}
+
+	Queue(Mary) mary;
+	QueueIter(Mary) maryIter = { mary };
+	Mary * m;
+
+	for ( ; maryIter >> m; ) {							// empty list
+		sout | m->i | m->j | ' ';
+	}
+	sout | "empty" | nl;
+	
+	for ( i = 0; i < 10; i += 1 ) {
+		add( mary, new( 2 * i ) );
+	}
+
+	for ( over( maryIter, mary ); maryIter >> m; ) {
+		sout | m->i | m->j | ' ';
+	}
+	sout | nl;
+	
+	for ( i = 0; i < 9; i += 1 ) {
+		delete( drop( mary ) );
+	}
+
+	for ( over( maryIter, mary ); maryIter >> m; ) {
+		sout | m->i | m->j | ' ';
+	}
+	sout | nl;
+	
+	for ( i = 0; i < 10; i += 1 ) {
+		add( mary, new( 2 * i + 1 ) );
+	}
+	for ( over( maryIter, mary ); maryIter >> m; ) {
+		sout | m->i | m->j | ' ';
+	}
+	sout | nl;
+
+	for ( over( maryIter, mary ); maryIter >> m; ) {
+		delete( m );
+	}
+}
+
+// Local Variables: //
+// compile-command: "cfa queue_example.cfa" //
+// End: //
Index: libcfa/src/bits/sequence.hfa
===================================================================
--- libcfa/src/bits/sequence.hfa	(revision 88a0ff6bf6d60cf5f082063e77f79648c618f122)
+++ libcfa/src/bits/sequence.hfa	(revision 88a0ff6bf6d60cf5f082063e77f79648c618f122)
@@ -0,0 +1,304 @@
+#pragma once
+
+#include "collection.hfa"
+
+struct Seqable {
+	inline Colable;
+	Seqable * back;										// pointer to previous node in the list
+};
+
+inline {
+	void ?{}( Seqable & sq ) with( sq ) {
+		((Colable & ) sq){};
+		back = 0p;
+	} // post: ! listed()
+
+	Seqable * getBack( Seqable & sq ) with( sq ) {
+		return back;
+	}
+
+	Seqable *& Back( Seqable * sq ) {
+		return sq->back;
+	}
+} // distribution
+
+forall( dtype T ) {
+	struct Sequence {
+		inline Collection;								// Plan 9 inheritance
+	};
+
+	inline {
+		// wrappers to make Collection have T
+		T * head( Sequence(T) & s ) with( s ) {
+			return (T *)head( (Collection &)s );
+		} // post: empty() & head() == 0 | !empty() & head() in *s
+
+		bool empty( Sequence(T) & s ) with( s ) {		// 0 <=> *s contains no elements
+			return empty( (Collection &)s );
+		}
+
+		bool listed( T * n ) {
+			return Next( (Colable *)n ) != 0;
+		}
+
+		T *& Next( T * n ) {
+			return (T *)Next( (Colable *)n );
+		}
+
+		T *& Back( T * n ) {
+			return (T *)Back( (Seqable *)n );
+		}
+
+		T * Root( Sequence(T) & s ) with( s ) {
+			return (T *)root;
+		}
+
+		void ?{}( Sequence(T) &, const Sequence(T) & ) = void; // no copy
+		Sequence(T) & ?=?( const Sequence(T) & ) = void; // no assignment
+
+		void ?{}( Sequence(T) & s ) with( s ) {	
+			((Collection &) s){};
+		}	// post: isEmpty().
+
+		// Return a pointer to the last sequence element, without removing it.	
+		T * tail( Sequence(T) & s ) with( s ) {
+			return root ? (T *)Back( Root( s ) ) : 0p;	// needs cast?
+		}	// post: empty() & tail() == 0 | !empty() & tail() in *s
+
+		// Return a pointer to the element after *n, or 0p if there isn't one.
+		T * succ( Sequence(T) & s, T * n ) with( s ) {	// pre: *n in *s
+#ifdef __CFA_DEBUG__
+			if ( ! listed( n ) ) abort( "(Sequence &)%p.succ( %p ) : Node is not on a list.", &s, n );
+#endif // __CFA_DEBUG__
+			return Next( n ) == Root( s ) ? 0p : Next( n );
+		}	// post: n == tail() & succ(n) == 0 | n != tail() & *succ(n) in *s
+
+		// Return a pointer to the element before *n, or 0p if there isn't one.
+		T * pred( Sequence(T) & s, T * n ) with( s ) {	// pre: *n in *s
+#ifdef __CFA_DEBUG__
+			if ( ! listed( n ) ) abort( "(Sequence &)%p.pred( %p ) : Node is not on a list.", &s, n );
+#endif // __CFA_DEBUG__
+			return n == Root( s ) ? 0p : Back( n );
+		}	// post: n == head() & head(n) == 0 | n != head() & *pred(n) in *s
+
+
+		// Insert *n into the sequence before *bef, or at the end if bef == 0.
+		void insertBef( Sequence(T) & s, T * n, T * bef ) with( s ) { // pre: !n->listed() & *bef in *s
+#ifdef __CFA_DEBUG__
+			if ( listed( n ) ) abort( "(Sequence &)%p.insertBef( %p, %p ) : Node is already on another list.", &s, n, bef );
+#endif // __CFA_DEBUG__
+			if ( bef == Root( s ) ) {					// must change root
+				if ( root ) {
+					Next( n ) = Root( s );
+					Back( n ) = Back( Root( s ) );
+					// inserted node must be consistent before it is seen
+					asm( "" : : : "memory" );			// prevent code movement across barrier
+					Back( Root( s ) ) = n;
+					Next( Back( n ) ) = n;
+				} else {
+					Next( n ) = n;
+					Back( n ) = n;
+				} // if
+				// inserted node must be consistent before it is seen
+				asm( "" : : : "memory" );				// prevent code movement across barrier
+				root = n;
+			} else {
+				if ( ! bef ) bef = Root( s );
+				Next( n ) = bef;
+				Back( n ) = Back( bef );
+				// inserted node must be consistent before it is seen
+				asm( "" : : : "memory" );				// prevent code movement across barrier
+				Back( bef ) = n;
+				Next( Back( n ) ) = n;
+			} // if
+		}	// post: n->listed() & *n in *s & succ(n) == bef
+
+
+		// Insert *n into the sequence after *aft, or at the beginning if aft == 0.
+		void insertAft( Sequence(T) & s, T *aft, T *n ) with( s ) {	// pre: !n->listed() & *aft in *s
+#ifdef __CFA_DEBUG__
+			if ( listed( n ) ) abort( "(Sequence &)%p.insertAft( %p, %p ) : Node is already on another list.", &s, aft, n );
+#endif // __CFA_DEBUG__
+			if ( ! aft ) {								// must change root
+				if ( root ) {
+					Next( n ) = Root( s );
+					Back( n ) = Back( Root( s ) );
+					// inserted node must be consistent before it is seen
+					asm( "" : : : "memory" );			// prevent code movement across barrier
+					Back( Root( s ) ) = n;
+					Next( Back( n ) ) = n;
+				} else {
+					Next( n ) = n;
+					Back( n ) = n;
+				} // if
+				asm( "" : : : "memory" );				// prevent code movement across barrier
+				root = n;
+			} else {
+				Next( n ) = Next( aft );
+				Back( n ) = aft;
+				// inserted node must be consistent before it is seen
+				asm( "" : : : "memory" );				// prevent code movement across barrier
+				Back( Next( n ) ) = n;
+				Next( aft ) = n;
+			} // if
+		}	  // post: n->listed() & *n in *s & succ(n) == bef
+		
+		// pre: n->listed() & *n in *s
+		void remove( Sequence(T) & s, T *n ) with( s ) { // O(1)
+#ifdef __CFA_DEBUG__
+			if ( ! listed( n ) ) abort( "(Sequence &)%p.remove( %p ) : Node is not on a list.", &s, n );
+#endif // __CFA_DEBUG__
+			if ( n == Root( s ) ) {
+				if ( Next( Root( s ) ) == Root( s ) ) root = 0p;
+				else root = Next( Root(s ) );
+			} // if
+			Back( Next( n ) ) = Back( n );
+			Next( Back( n ) ) = Next( n );
+			Next( n ) = Back( n ) = 0p;
+		}							// post: !n->listed().
+
+		// Add an element to the head of the sequence.
+		void addHead( Sequence(T) & s, T *n ) {			// pre: !n->listed(); post: n->listed() & head() == n
+			insertAft( s, 0, n );
+		}
+		// Add an element to the tail of the sequence.
+		void addTail( Sequence(T) & s, T *n ) {			// pre: !n->listed(); post: n->listed() & head() == n
+			insertBef( s, n, 0 );
+		}
+		// Add an element to the tail of the sequence.
+		void add( Sequence(T) & s, T *n ) {				// pre: !n->listed(); post: n->listed() & head() == n
+			addTail( s, n );
+		}
+		// Remove and return the head element in the sequence.
+		T * dropHead( Sequence(T) & s ) {
+			T * n = head( s );
+			return n ? remove( s, n ), n : 0p;
+		}
+		// Remove and return the head element in the sequence.
+		T * drop( Sequence(T) & s ) {
+			return dropHead( s );
+		}
+		// Remove and return the tail element in the sequence.
+		T * dropTail( Sequence(T) & s ) {
+			T * n = tail( s );
+			return n ? remove( s, n ), n : 0p;
+		}
+
+		// Transfer the "from" list to the end of s sequence; the "from" list is empty after the transfer.
+		void transfer( Sequence(T) & s, Sequence(T) & from ) with( s ) {
+			if ( empty( from ) ) return;				// "from" list empty ?
+			if ( empty( s ) ) {							// "to" list empty ?
+				root = from.root;
+			} else {									// "to" list not empty
+				T * toEnd = Back( Root( s ) );
+				T * fromEnd = Back( Root( from ) );
+				Back( root ) = fromEnd;
+				Next( fromEnd ) = Root( s );
+				Back( from.root ) = toEnd;
+				Next( toEnd ) = Root( from );
+			} // if
+			from.root = 0p;								// mark "from" list empty
+		}
+
+		// Transfer the "from" list up to node "n" to the end of s list; the "from" list becomes the sequence after node "n".
+		// Node "n" must be in the "from" list.
+		void split( Sequence(T) & s, Sequence(T) & from, T * n ) with( s ) {
+#ifdef __CFA_DEBUG__
+			if ( ! listed( n ) ) abort( "(Sequence &)%p.split( %p ) : Node is not on a list.", &s, n );
+#endif // __CFA_DEBUG__
+			Sequence(T) to;
+			to.root = from.root;						// start of "to" list
+			from.root = Next( n );						// start of "from" list
+			if ( to.root == from.root ) {				// last node in list ?
+				from.root = 0p;							// mark "from" list empty
+			} else {
+				Back( Root( from ) ) = Back( Root( to ) ); // fix "from" list
+		 		Next( Back( Root( to ) ) ) = Root( from );
+				Next( n ) = Root( to );					// fix "to" list
+				Back( Root( to ) ) = n;
+			} // if
+			transfer( s, to );
+		}
+	} // distribution
+} // distribution
+
+forall( dtype T ) {
+	// SeqIter(T) is used to iterate over a Sequence(T) in head-to-tail order.
+	struct SeqIter {
+		inline ColIter;
+		Sequence(T) * seq;
+	};
+
+	inline {
+		// wrappers to make ColIter have T
+		T * Curr( SeqIter(T) & si ) with( si ) {
+			return (T *)curr;
+		}
+
+		void ?{}( SeqIter(T) & si ) with( si ) {	
+			((ColIter &) si){};
+			seq = 0p;
+		} // post: elts = null.
+
+		void ?{}( SeqIter(T) & si, Sequence(T) & s ) with( si ) {
+			((ColIter &) si){};
+			seq = &s;
+		} // post: elts = null.
+		
+		void over( SeqIter(T) & si, Sequence(T) & s ) with( si ) {
+			seq = &s;
+			curr = head( s );
+		} // post: elts = {e in s}.
+
+		bool ?>>?( SeqIter(T) & si, T *& tp ) with( si ) {
+			if ( curr ) {
+				tp = Curr( si );
+				T *n = succ( *seq, Curr( si ) );
+				curr = n == head( *seq ) ? 0p : n;
+			} else tp = 0p;
+			return tp != 0p;
+		}
+	} // distribution
+
+
+	// A SeqIterRev(T) is used to iterate over a Sequence(T) in tail-to-head order.
+	struct SeqIterRev {
+		inline ColIter;
+		Sequence(T) * seq;
+	};
+
+	inline {
+		// wrappers to make ColIter have T
+		T * Curr( SeqIterRev(T) & si ) with( si ) {
+			return (T *)curr;
+		}
+
+		void ?{}( SeqIterRev(T) & si ) with( si ) {	
+			((ColIter &) si){};
+			seq = 0p;
+		} // post: elts = null.
+
+		void ?{}( SeqIterRev(T) & si, Sequence(T) & s ) with( si ) {	
+			((ColIter &) si){};
+			seq = &s;
+		} // post: elts = null.
+		
+		void over( SeqIterRev(T) & si, Sequence(T) & s ) with( si ) {
+			seq = &s;
+			curr = tail( s );
+		} // post: elts = {e in s}.
+
+		bool ?>>?( SeqIterRev(T) & si, T *&tp ) with( si ) {
+			if ( curr ) {
+				tp = Curr( si );
+				T *n = pred( *seq, Curr( si ) );
+				curr = n == tail( *seq ) ? 0p : n;
+			} else tp = 0p;
+			return tp != 0p;
+		}
+	} // distribution
+} // distribution
+
+// Local Variables: //
+// compile-command: "make install" //
+// End: //
Index: libcfa/src/bits/sequence_example.cfa
===================================================================
--- libcfa/src/bits/sequence_example.cfa	(revision 88a0ff6bf6d60cf5f082063e77f79648c618f122)
+++ libcfa/src/bits/sequence_example.cfa	(revision 88a0ff6bf6d60cf5f082063e77f79648c618f122)
@@ -0,0 +1,143 @@
+#include <fstream.hfa>
+#include <stdlib.hfa>									// new, delete
+#include "sequence.hfa"
+
+int main() {
+	// Fred test
+
+	struct Fred {
+		inline Seqable;									// Plan 9 inheritance
+		int i;
+	};
+	void ?{}( Fred & fred ) { abort(); }
+	void ?{}( Fred & fred, int p ) with( fred ) {
+		i = p;
+	}
+
+	Sequence(Fred) fred;
+	SeqIter(Fred) fredIter = { fred };
+	Fred * f;
+	int i;
+
+	sout | nlOff;										// turn off auto newline
+
+	for ( ; fredIter >> f; ) {							// empty list
+		sout | f->i | ' ';
+	}
+	sout | "empty" | nl;
+	
+	for ( i = 0; i < 10; i += 1 ) {
+		add( fred, new( 2 * i ) );
+	}
+
+	for ( over( fredIter, fred ); fredIter >> f; ) {
+		sout | f->i | ' ';
+	}
+	sout | nl;
+
+	for ( i = 0; i < 9; i += 1 ) {
+		delete( dropHead( fred ) );
+	}
+
+	for ( over( fredIter, fred ); fredIter >> f; ) {
+		sout | f->i | ' ';
+	}
+	sout | nl;
+	
+	for ( i = 0; i < 10; i += 1 ) {
+		addTail( fred, new( 2 * i + 1 ) );
+	}
+	for ( over( fredIter, fred ); fredIter >> f; ) {
+		sout | f->i | ' ';
+	}
+	sout | nl;
+
+	for ( i = 0; i < 9; i += 1 ) {
+		delete( dropTail( fred ) );
+	}
+	for ( over( fredIter, fred ); fredIter >> f; ) {
+		sout | f->i | ' ';
+	}
+	sout | nl;
+
+	for ( over( fredIter, fred ); fredIter >> f; ) {
+		delete( f );
+	}
+
+	// Mary test
+
+	struct Mary {
+		inline Fred;									// Plan 9 inheritance
+		int j;
+	};
+	void ?{}( Mary & mary ) { abort(); }
+	void ?{}( Mary & mary, int p ) with( mary ) {
+		((Fred &)mary){ p };
+		j = p;
+	}
+
+	Sequence(Mary) mary;
+	Sequence(Mary) baz;
+	SeqIter(Mary) maryIter = { mary };
+	Mary * m;
+
+	for ( ; maryIter >> m; ) {							// empty list
+		sout | m->i | m->j | ' ';
+	}
+	sout | "empty" | nl;
+	
+	for ( i = 0; i < 10; i += 1 ) {
+		add( mary, new( 2 * i ) );
+		add( baz, new( 2 * i ) );
+	}
+
+	for ( over( maryIter, mary ); maryIter >> m; ) {
+		sout | m->i | m->j | ' ';
+	}
+	sout | nl;
+	
+	for ( i = 0; i < 9; i += 1 ) {
+		delete( dropHead( mary ) );
+	}
+
+	for ( over( maryIter, mary ); maryIter >> m; ) {
+		sout | m->i | m->j | ' ';
+	}
+	sout | nl;
+	
+	for ( i = 0; i < 10; i += 1 ) {
+		addTail( mary, new( 2 * i + 1 ) );
+	}
+	for ( over( maryIter, mary ); maryIter >> m; ) {
+		sout | m->i | m->j | ' ';
+	}
+	sout | nl;
+
+	for ( i = 0; i < 9; i += 1 ) {
+		delete( dropTail( mary ) );
+	}
+	for ( over( maryIter, mary ); maryIter >> m; ) {
+		sout | m->i | m->j | ' ';
+	}
+	sout | nl;
+
+	transfer( mary, baz );
+
+	for ( over( maryIter, baz ); maryIter >> m; ) {
+		sout | m->i | m->j | ' ';
+	}
+	sout | "empty" | nl;
+
+	for ( over( maryIter, mary ); maryIter >> m; ) {
+		sout | m->i | m->j | ' ';
+	}
+	sout | nl;
+
+	for ( over( maryIter, mary ); maryIter >> m; ) {
+		delete( m );
+	}
+}
+
+// Local Variables: //
+// compile-command: "cfa sequence_example.cc" //
+// End: //
Index: libcfa/src/bits/stack.hfa
===================================================================
--- libcfa/src/bits/stack.hfa	(revision 88a0ff6bf6d60cf5f082063e77f79648c618f122)
+++ libcfa/src/bits/stack.hfa	(revision 88a0ff6bf6d60cf5f082063e77f79648c618f122)
@@ -0,0 +1,114 @@
+#pragma once
+
+#include "collection.hfa"
+
+forall( dtype T ) {
+	struct Stack {
+		inline Collection;								// Plan 9 inheritance
+	};
+
+	inline {
+		// wrappers to make Collection have T
+		T * head( Stack(T) & s ) with( s ) {
+			return (T *)head( (Collection &)s );
+		} // post: empty() & head() == 0 | !empty() & head() in *this
+
+		bool empty( Stack(T) & s ) with( s ) {			// 0 <=> *this contains no elements
+			return empty( (Collection &)s );
+		}
+
+		T *& Next( T * n ) {
+			return (T *)Next( (Colable *)n );
+		}
+
+		T * Root( Stack(T) & s ) with( s ) {
+			return (T *)root;
+		}
+
+		void ?{}( Stack(T) &, const Stack(T) & ) = void; // no copy
+		Stack(T) & ?=?( const Stack(T) & ) = void;		// no assignment
+
+		void ?{}( Stack(T) & s ) with( s ) {
+			((Collection &)s){};
+		} // post: empty()
+
+		T * top( Stack(T) & s ) with( s ) {
+			return head( s );
+		}
+
+		void addHead( Stack(T) & s, T * n ) with( s ) {
+#ifdef __CFA_DEBUG__
+			if ( listed( (Colable &)(*n) ) ) abort( "(Stack &)%p.addHead( %p ) : Node is already on another list.", &s, n );
+#endif // __CFA_DEBUG__
+			Next( n ) = Root( s ) ? Root( s ) : n;
+			root = n;
+		}
+
+		void add( Stack(T) & s, T * n ) with( s ) {
+			addHead( s, n );
+		}
+
+		void push( Stack(T) & s, T * n ) with( s ) {
+			addHead( s, n );
+		}
+
+		T * drop( Stack(T) & s ) with( s ) {
+			T * t = head( s );
+			if ( root ) {
+				root = ( T *)Next(root);
+				if ( Root( s ) == t ) root = 0p;		// only one element ?
+				Next( t ) = 0p;
+			} // if
+			return t;
+		}
+
+		T * pop( Stack(T) & s ) with( s ) {
+			return drop( s );
+		}
+	} // distribution
+} // distribution
+
+
+forall( dtype T ) {
+	struct StackIter {
+		inline ColIter;									// Plan 9 inheritance
+	};	
+
+	inline {
+		// wrappers to make ColIter have T
+		T * Curr( StackIter(T) & si ) with( si ) {
+			return (T *)curr;
+		}
+
+		void ?{}( StackIter(T) & si ) with( si ) {
+			((ColIter &)si){};
+		} // post: curr == 0p
+
+		// create an iterator active in Stack s
+		void ?{}( StackIter(T) & si, Stack(T) & s ) with( si ) {
+			curr = head( s );
+		} // post: curr = {e in s}
+
+		void ?{}( StackIter(T) & si, T * start ) with( si ) {
+			curr = start;
+		} // post: curr = {e in s}
+
+		// make existing iterator active in Stack q
+		void over( StackIter(T) & si, Stack(T) & s ) with( si ) {
+			curr = head( s );
+		} // post: curr = {e in s}
+
+		bool ?>>?( StackIter(T) & si, T *& tp ) with( si ) {
+			if ( curr ) {
+				tp = Curr( si );
+				T * n = Next( Curr( si ) );
+				curr = (n == Curr( si ) ) ? 0p : n;
+			} else tp = 0p;
+			return tp != 0p;
+		}
+	} // distribution
+} // distribution
+
+// Local Variables: //
+// compile-command: "make install" //
+// End: //
Index: libcfa/src/bits/stack_example.cfa
===================================================================
--- libcfa/src/bits/stack_example.cfa	(revision 88a0ff6bf6d60cf5f082063e77f79648c618f122)
+++ libcfa/src/bits/stack_example.cfa	(revision 88a0ff6bf6d60cf5f082063e77f79648c618f122)
@@ -0,0 +1,113 @@
+#include <fstream.hfa>
+#include <stdlib.hfa>									// new, delete
+#include "stack.hfa"
+
+int main() {
+	// Fred test
+
+	struct Fred {
+		inline Colable;									// Plan 9 inheritance
+		int i;
+	};
+	void ?{}( Fred & fred ) { abort(); }
+	void ?{}( Fred & fred, int p ) with( fred ) {
+		i = p;
+	}
+
+	Stack(Fred) fred;
+	StackIter(Fred) fredIter = { fred };
+	Fred * f;
+	int i;
+
+	sout | nlOff;										// turn off auto newline
+
+	for ( ; fredIter >> f; ) {							// empty list
+		sout | f->i | ' ';
+	}
+	sout | "empty" | nl;
+	
+	for ( i = 0; i < 10; i += 1 ) {
+		push( fred, new( 2 * i ) );
+	}
+
+	for ( over( fredIter, fred ); fredIter >> f; ) {
+		sout | f->i | ' ';
+	}
+	sout | nl;
+	
+	for ( i = 0; i < 9; i += 1 ) {
+		delete( pop( fred ) );
+	}
+
+	for ( over( fredIter, fred ); fredIter >> f; ) {
+		sout | f->i | ' ';
+	}
+	sout | nl;
+	
+	for ( i = 0; i < 10; i += 1 ) {
+		push( fred, new( 2 * i + 1 ) );
+	}
+	for ( over( fredIter, fred ); fredIter >> f; ) {
+		sout | f->i | ' ';
+	}
+	sout | nl;
+
+	for ( over( fredIter, fred ); fredIter >> f; ) {
+		delete( f );
+	}
+
+	// Mary test
+
+	struct Mary {
+		inline Fred;									// Plan 9 inheritance
+		int j;
+	};
+	void ?{}( Mary & mary ) { abort(); }
+	void ?{}( Mary & mary, int p ) with( mary ) {
+		((Fred &)mary){ p };
+		j = i = p;
+	}
+
+	Stack(Mary) mary;
+	StackIter(Mary) maryIter = { mary };
+	Mary * m;
+
+	for ( ; maryIter >> m; ) {							// empty list
+		sout | m->i | m->j | ' ';
+	}
+	sout | "empty" | nl;
+	
+	for ( i = 0; i < 10; i += 1 ) {
+		push( mary, new( 2 * i ) );
+	}
+
+	for ( over( maryIter, mary ); maryIter >> m; ) {
+		sout | m->i | m->j | ' ';
+	}
+	sout | nl;
+	
+	for ( i = 0; i < 9; i += 1 ) {
+		delete( pop( mary ) );
+	}
+
+	for ( over( maryIter, mary ); maryIter >> m; ) {
+		sout | m->i | m->j | ' ';
+	}
+	sout | nl;
+	
+	for ( i = 0; i < 10; i += 1 ) {
+		push( mary, new( 2 * i + 1 ) );
+	}
+	for ( over( maryIter, mary ); maryIter >> m; ) {
+		sout | m->i | m->j | ' ';
+	}
+	sout | nl;
+
+	for ( over( maryIter, mary ); maryIter >> m; ) {
+		delete( m );
+	}
+}
+
+// Local Variables: //
+// compile-command: "cfa stack_example.cfa" //
+// End: //
Index: src/AST/Decl.hpp
===================================================================
--- src/AST/Decl.hpp	(revision 13898103d95655f9105ab4f220516ac97d1cb04e)
+++ src/AST/Decl.hpp	(revision 88a0ff6bf6d60cf5f082063e77f79648c618f122)
@@ -75,11 +75,4 @@
 	int scopeLevel = 0;
 
-	/*
-	ForallDecl foralls {
-		list<TypeDecl> params
-		list<ObjectDecl> assns
-	}
-	*/
-
 	std::vector<ptr<Attribute>> attributes;
 	Function::Specs funcSpec;
Index: src/AST/Type.hpp
===================================================================
--- src/AST/Type.hpp	(revision 13898103d95655f9105ab4f220516ac97d1cb04e)
+++ src/AST/Type.hpp	(revision 88a0ff6bf6d60cf5f082063e77f79648c618f122)
@@ -274,10 +274,6 @@
 public:
 	using ForallList = std::vector<ptr<TypeDecl>>;
-	// using ForallList = std::vector<readonly<TypeDecl>>;
-
-	// using ForallList = std::vector<ptr<TypeInstType>>;
+
 	ForallList forall;
-	// using AssertionList = std::vector<ptr<VariableExpr>>;
-	// AssertionList assertions;
 
 	ParameterizedType( ForallList&& fs = {}, CV::Qualifiers q = {},
@@ -427,5 +423,4 @@
 public:
 	readonly<TypeDecl> base;
-	// int context;
 	TypeDecl::Kind kind;
 
@@ -544,10 +539,8 @@
 }
 
-
 #undef MUTATE_FRIEND
 
 // Local Variables: //
 // tab-width: 4 //
-
 // mode: c++ //
 // compile-command: "make install" //
Index: src/ResolvExpr/CandidateFinder.cpp
===================================================================
--- src/ResolvExpr/CandidateFinder.cpp	(revision 13898103d95655f9105ab4f220516ac97d1cb04e)
+++ src/ResolvExpr/CandidateFinder.cpp	(revision 88a0ff6bf6d60cf5f082063e77f79648c618f122)
@@ -1595,5 +1595,5 @@
 					// unification run for side-effects
 					bool canUnify = unify( toType, cand->expr->result, env, need, have, open, symtab );
-                    (void) canUnify;
+					(void) canUnify;
 					Cost thisCost = computeConversionCost( cand->expr->result, toType, cand->expr->get_lvalue(),
 						symtab, env );
Index: src/SymTab/Mangler.cc
===================================================================
--- src/SymTab/Mangler.cc	(revision 13898103d95655f9105ab4f220516ac97d1cb04e)
+++ src/SymTab/Mangler.cc	(revision 88a0ff6bf6d60cf5f082063e77f79648c618f122)
@@ -10,6 +10,6 @@
 // Created On       : Sun May 17 21:40:29 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Feb 15 13:55:12 2020
-// Update Count     : 33
+// Last Modified On : Wed Nov 18 12:01:38 2020
+// Update Count     : 64
 //
 #include "Mangler.h"
@@ -65,7 +65,7 @@
 				void postvisit( const QualifiedType * qualType );
 
-				std::string get_mangleName() { return mangleName.str(); }
+				std::string get_mangleName() { return mangleName; }
 			  private:
-				std::ostringstream mangleName;  ///< Mangled name being constructed
+				std::string mangleName;         ///< Mangled name being constructed
 				typedef std::map< std::string, std::pair< int, int > > VarMapType;
 				VarMapType varNums;             ///< Map of type variables to indices
@@ -127,10 +127,10 @@
 					isTopLevel = false;
 				} // if
-				mangleName << Encoding::manglePrefix;
+				mangleName += Encoding::manglePrefix;
 				const CodeGen::OperatorInfo * opInfo = CodeGen::operatorLookup( declaration->get_name() );
 				if ( opInfo ) {
-					mangleName << opInfo->outputName.size() << opInfo->outputName;
+					mangleName += std::to_string( opInfo->outputName.size() ) + opInfo->outputName;
 				} else {
-					mangleName << declaration->name.size() << declaration->name;
+					mangleName += std::to_string( declaration->name.size() ) + declaration->name;
 				} // if
 				maybeAccept( declaration->get_type(), *visitor );
@@ -139,7 +139,7 @@
 					// so they need a different name mangling
 					if ( declaration->get_linkage() == LinkageSpec::AutoGen ) {
-						mangleName << Encoding::autogen;
+						mangleName += Encoding::autogen;
 					} else if ( declaration->get_linkage() == LinkageSpec::Intrinsic ) {
-						mangleName << Encoding::intrinsic;
+						mangleName += Encoding::intrinsic;
 					} else {
 						// if we add another kind of overridable function, this has to change
@@ -160,5 +160,5 @@
 			void Mangler_old::postvisit( const VoidType * voidType ) {
 				printQualifiers( voidType );
-				mangleName << Encoding::void_t;
+				mangleName += Encoding::void_t;
 			}
 
@@ -166,5 +166,5 @@
 				printQualifiers( basicType );
 				assertf( basicType->kind < BasicType::NUMBER_OF_BASIC_TYPES, "Unhandled basic type: %d", basicType->kind );
-				mangleName << Encoding::basicTypes[ basicType->kind ];
+				mangleName += Encoding::basicTypes[ basicType->kind ];
 			}
 
@@ -172,5 +172,5 @@
 				printQualifiers( pointerType );
 				// mangle void (*f)() and void f() to the same name to prevent overloading on functions and function pointers
-				if ( ! dynamic_cast<FunctionType *>( pointerType->base ) ) mangleName << Encoding::pointer;
+				if ( ! dynamic_cast<FunctionType *>( pointerType->base ) ) mangleName += Encoding::pointer;
 				maybeAccept( pointerType->base, *visitor );
 			}
@@ -179,5 +179,5 @@
 				// TODO: encode dimension
 				printQualifiers( arrayType );
-				mangleName << Encoding::array << "0";
+				mangleName += Encoding::array + "0";
 				maybeAccept( arrayType->base, *visitor );
 			}
@@ -204,5 +204,5 @@
 			void Mangler_old::postvisit( const FunctionType * functionType ) {
 				printQualifiers( functionType );
-				mangleName << Encoding::function;
+				mangleName += Encoding::function;
 				// turn on inFunctionType so that printQualifiers does not print most qualifiers for function parameters,
 				// since qualifiers on outermost parameter type do not differentiate function types, e.g.,
@@ -211,10 +211,10 @@
 				inFunctionType = true;
 				std::list< Type* > returnTypes = getTypes( functionType->returnVals );
-				if (returnTypes.empty()) mangleName << Encoding::void_t;
+				if (returnTypes.empty()) mangleName += Encoding::void_t;
 				else acceptAll( returnTypes, *visitor );
-				mangleName << "_";
+				mangleName += "_";
 				std::list< Type* > paramTypes = getTypes( functionType->parameters );
 				acceptAll( paramTypes, *visitor );
-				mangleName << "_";
+				mangleName += "_";
 			}
 
@@ -222,10 +222,10 @@
 				printQualifiers( refType );
 
-				mangleName << prefix << refType->name.length() << refType->name;
+				mangleName += prefix + std::to_string( refType->name.length() ) + refType->name;
 
 				if ( mangleGenericParams ) {
 					const std::list< Expression* > & params = refType->parameters;
 					if ( ! params.empty() ) {
-						mangleName << "_";
+						mangleName += "_";
 						for ( const Expression * param : params ) {
 							const TypeExpr * paramType = dynamic_cast< const TypeExpr * >( param );
@@ -233,5 +233,5 @@
 							maybeAccept( paramType->type, *visitor );
 						}
-						mangleName << "_";
+						mangleName += "_";
 					}
 				}
@@ -262,5 +262,5 @@
 					// are first found and prefixing with the appropriate encoding for the type class.
 					assertf( varNum->second.second < TypeDecl::NUMBER_OF_KINDS, "Unhandled type variable kind: %d", varNum->second.second );
-					mangleName << Encoding::typeVariables[varNum->second.second] << varNum->second.first;
+					mangleName += Encoding::typeVariables[varNum->second.second] + std::to_string( varNum->second.first );
 				} // if
 			}
@@ -268,10 +268,10 @@
 			void Mangler_old::postvisit( const TraitInstType * inst ) {
 				printQualifiers( inst );
-				mangleName << inst->name.size() << inst->name;
+				mangleName += std::to_string( inst->name.size() ) + inst->name;
 			}
 
 			void Mangler_old::postvisit( const TupleType * tupleType ) {
 				printQualifiers( tupleType );
-				mangleName << Encoding::tuple << tupleType->types.size();
+				mangleName += Encoding::tuple + std::to_string( tupleType->types.size() );
 				acceptAll( tupleType->types, *visitor );
 			}
@@ -280,13 +280,13 @@
 				printQualifiers( varArgsType );
 				static const std::string vargs = "__builtin_va_list";
-				mangleName << Encoding::type << vargs.size() << vargs;
+				mangleName += Encoding::type + std::to_string( vargs.size() ) + vargs;
 			}
 
 			void Mangler_old::postvisit( const ZeroType * ) {
-				mangleName << Encoding::zero;
+				mangleName += Encoding::zero;
 			}
 
 			void Mangler_old::postvisit( const OneType * ) {
-				mangleName << Encoding::one;
+				mangleName += Encoding::one;
 			}
 
@@ -296,5 +296,5 @@
 					// N marks the start of a qualified type
 					inQualifiedType = true;
-					mangleName << Encoding::qualifiedTypeStart;
+					mangleName += Encoding::qualifiedTypeStart;
 				}
 				maybeAccept( qualType->parent, *visitor );
@@ -303,5 +303,5 @@
 					// E marks the end of a qualified type
 					inQualifiedType = false;
-					mangleName << Encoding::qualifiedTypeEnd;
+					mangleName += Encoding::qualifiedTypeEnd;
 				}
 			}
@@ -315,5 +315,5 @@
 				assertf(false, "Mangler_old should not visit typedecl: %s", toCString(decl));
 				assertf( decl->kind < TypeDecl::NUMBER_OF_KINDS, "Unhandled type variable kind: %d", decl->kind );
-				mangleName << Encoding::typeVariables[ decl->kind ] << ( decl->name.length() ) << decl->name;
+				mangleName += Encoding::typeVariables[ decl->kind ] + std::to_string( decl->name.length() ) + decl->name;
 			}
 
@@ -330,5 +330,5 @@
 					std::list< std::string > assertionNames;
 					int dcount = 0, fcount = 0, vcount = 0, acount = 0;
-					mangleName << Encoding::forall;
+					mangleName += Encoding::forall;
 					for ( const TypeDecl * i : type->forall ) {
 						switch ( i->kind ) {
@@ -354,26 +354,27 @@
 						} // for
 					} // for
-					mangleName << dcount << "_" << fcount << "_" << vcount << "_" << acount << "_";
-					std::copy( assertionNames.begin(), assertionNames.end(), std::ostream_iterator< std::string >( mangleName, "" ) );
-					mangleName << "_";
+					mangleName += std::to_string( dcount ) + "_" + std::to_string( fcount ) + "_" + std::to_string( vcount ) + "_" + std::to_string( acount ) + "_";
+					for(const auto & a : assertionNames) mangleName += a;
+//					std::copy( assertionNames.begin(), assertionNames.end(), std::ostream_iterator< std::string >( mangleName, "" ) );
+					mangleName += "_";
 				} // if
 				if ( ! inFunctionType ) {
 					// these qualifiers do not distinguish the outermost type of a function parameter
 					if ( type->get_const() ) {
-						mangleName << Encoding::qualifiers.at(Type::Const);
+						mangleName += Encoding::qualifiers.at(Type::Const);
 					} // if
 					if ( type->get_volatile() ) {
-						mangleName << Encoding::qualifiers.at(Type::Volatile);
+						mangleName += Encoding::qualifiers.at(Type::Volatile);
 					} // if
 					// Removed due to restrict not affecting function compatibility in GCC
 					// if ( type->get_isRestrict() ) {
-					// 	mangleName << "E";
+					// 	mangleName += "E";
 					// } // if
 					if ( type->get_atomic() ) {
-						mangleName << Encoding::qualifiers.at(Type::Atomic);
+						mangleName += Encoding::qualifiers.at(Type::Atomic);
 					} // if
 				}
 				if ( type->get_mutex() ) {
-					mangleName << Encoding::qualifiers.at(Type::Mutex);
+					mangleName += Encoding::qualifiers.at(Type::Mutex);
 				} // if
 				if ( inFunctionType ) {
@@ -383,5 +384,5 @@
 				}
 			}
-		}	// namespace
+		} // namespace
 	} // namespace Mangler
 } // namespace SymTab
@@ -417,7 +418,7 @@
 			void postvisit( const ast::QualifiedType * qualType );
 
-			std::string get_mangleName() { return mangleName.str(); }
+			std::string get_mangleName() { return mangleName; }
 		  private:
-			std::ostringstream mangleName;  ///< Mangled name being constructed
+			std::string mangleName;         ///< Mangled name being constructed
 			typedef std::map< std::string, std::pair< int, int > > VarMapType;
 			VarMapType varNums;             ///< Map of type variables to indices
@@ -470,10 +471,10 @@
 				isTopLevel = false;
 			} // if
-			mangleName << Encoding::manglePrefix;
+			mangleName += Encoding::manglePrefix;
 			const CodeGen::OperatorInfo * opInfo = CodeGen::operatorLookup( decl->name );
 			if ( opInfo ) {
-				mangleName << opInfo->outputName.size() << opInfo->outputName;
+				mangleName += std::to_string( opInfo->outputName.size() ) + opInfo->outputName;
 			} else {
-				mangleName << decl->name.size() << decl->name;
+				mangleName += std::to_string( decl->name.size() ) + decl->name;
 			} // if
 			maybeAccept( decl->get_type(), *visitor );
@@ -482,7 +483,7 @@
 				// so they need a different name mangling
 				if ( decl->linkage == ast::Linkage::AutoGen ) {
-					mangleName << Encoding::autogen;
+					mangleName += Encoding::autogen;
 				} else if ( decl->linkage == ast::Linkage::Intrinsic ) {
-					mangleName << Encoding::intrinsic;
+					mangleName += Encoding::intrinsic;
 				} else {
 					// if we add another kind of overridable function, this has to change
@@ -503,5 +504,5 @@
 		void Mangler_new::postvisit( const ast::VoidType * voidType ) {
 			printQualifiers( voidType );
-			mangleName << Encoding::void_t;
+			mangleName += Encoding::void_t;
 		}
 
@@ -509,5 +510,5 @@
 			printQualifiers( basicType );
 			assertf( basicType->kind < ast::BasicType::NUMBER_OF_BASIC_TYPES, "Unhandled basic type: %d", basicType->kind );
-			mangleName << Encoding::basicTypes[ basicType->kind ];
+			mangleName += Encoding::basicTypes[ basicType->kind ];
 		}
 
@@ -515,5 +516,5 @@
 			printQualifiers( pointerType );
 			// mangle void (*f)() and void f() to the same name to prevent overloading on functions and function pointers
-			if ( ! pointerType->base.as<ast::FunctionType>() ) mangleName << Encoding::pointer;
+			if ( ! pointerType->base.as<ast::FunctionType>() ) mangleName += Encoding::pointer;
 			maybe_accept( pointerType->base.get(), *visitor );
 		}
@@ -522,5 +523,5 @@
 			// TODO: encode dimension
 			printQualifiers( arrayType );
-			mangleName << Encoding::array << "0";
+			mangleName += Encoding::array + "0";
 			maybeAccept( arrayType->base.get(), *visitor );
 		}
@@ -545,5 +546,5 @@
 		void Mangler_new::postvisit( const ast::FunctionType * functionType ) {
 			printQualifiers( functionType );
-			mangleName << Encoding::function;
+			mangleName += Encoding::function;
 			// turn on inFunctionType so that printQualifiers does not print most qualifiers for function parameters,
 			// since qualifiers on outermost parameter type do not differentiate function types, e.g.,
@@ -551,9 +552,9 @@
 			GuardValue( inFunctionType );
 			inFunctionType = true;
-			if (functionType->returns.empty()) mangleName << Encoding::void_t;
+			if (functionType->returns.empty()) mangleName += Encoding::void_t;
 			else accept_each( functionType->returns, *visitor );
-			mangleName << "_";
+			mangleName += "_";
 			accept_each( functionType->params, *visitor );
-			mangleName << "_";
+			mangleName += "_";
 		}
 
@@ -561,9 +562,9 @@
 			printQualifiers( refType );
 
-			mangleName << prefix << refType->name.length() << refType->name;
+			mangleName += prefix + std::to_string( refType->name.length() ) + refType->name;
 
 			if ( mangleGenericParams ) {
 				if ( ! refType->params.empty() ) {
-					mangleName << "_";
+					mangleName += "_";
 					for ( const ast::Expr * param : refType->params ) {
 						auto paramType = dynamic_cast< const ast::TypeExpr * >( param );
@@ -571,5 +572,5 @@
 						maybeAccept( paramType->type.get(), *visitor );
 					}
-					mangleName << "_";
+					mangleName += "_";
 				}
 			}
@@ -600,5 +601,5 @@
 				// are first found and prefixing with the appropriate encoding for the type class.
 				assertf( varNum->second.second < TypeDecl::NUMBER_OF_KINDS, "Unhandled type variable kind: %d", varNum->second.second );
-				mangleName << Encoding::typeVariables[varNum->second.second] << varNum->second.first;
+				mangleName += Encoding::typeVariables[varNum->second.second] + std::to_string( varNum->second.first );
 			} // if
 		}
@@ -606,10 +607,10 @@
 		void Mangler_new::postvisit( const ast::TraitInstType * inst ) {
 			printQualifiers( inst );
-			mangleName << inst->name.size() << inst->name;
+			mangleName += std::to_string( inst->name.size() ) + inst->name;
 		}
 
 		void Mangler_new::postvisit( const ast::TupleType * tupleType ) {
 			printQualifiers( tupleType );
-			mangleName << Encoding::tuple << tupleType->types.size();
+			mangleName += Encoding::tuple + std::to_string( tupleType->types.size() );
 			accept_each( tupleType->types, *visitor );
 		}
@@ -618,13 +619,13 @@
 			printQualifiers( varArgsType );
 			static const std::string vargs = "__builtin_va_list";
-			mangleName << Encoding::type << vargs.size() << vargs;
+			mangleName += Encoding::type + std::to_string( vargs.size() ) + vargs;
 		}
 
 		void Mangler_new::postvisit( const ast::ZeroType * ) {
-			mangleName << Encoding::zero;
+			mangleName += Encoding::zero;
 		}
 
 		void Mangler_new::postvisit( const ast::OneType * ) {
-			mangleName << Encoding::one;
+			mangleName += Encoding::one;
 		}
 
@@ -634,5 +635,5 @@
 				// N marks the start of a qualified type
 				inQualifiedType = true;
-				mangleName << Encoding::qualifiedTypeStart;
+				mangleName += Encoding::qualifiedTypeStart;
 			}
 			maybeAccept( qualType->parent.get(), *visitor );
@@ -641,5 +642,5 @@
 				// E marks the end of a qualified type
 				inQualifiedType = false;
-				mangleName << Encoding::qualifiedTypeEnd;
+				mangleName += Encoding::qualifiedTypeEnd;
 			}
 		}
@@ -653,5 +654,5 @@
 			assertf(false, "Mangler_new should not visit typedecl: %s", toCString(decl));
 			assertf( decl->kind < ast::TypeDecl::Kind::NUMBER_OF_KINDS, "Unhandled type variable kind: %d", decl->kind );
-			mangleName << Encoding::typeVariables[ decl->kind ] << ( decl->name.length() ) << decl->name;
+			mangleName += Encoding::typeVariables[ decl->kind ] + std::to_string( decl->name.length() ) + decl->name;
 		}
 
@@ -669,5 +670,5 @@
 					std::list< std::string > assertionNames;
 					int dcount = 0, fcount = 0, vcount = 0, acount = 0;
-					mangleName << Encoding::forall;
+					mangleName += Encoding::forall;
 					for ( const ast::TypeDecl * decl : ptype->forall ) {
 						switch ( decl->kind ) {
@@ -693,7 +694,8 @@
 						} // for
 					} // for
-					mangleName << dcount << "_" << fcount << "_" << vcount << "_" << acount << "_";
-					std::copy( assertionNames.begin(), assertionNames.end(), std::ostream_iterator< std::string >( mangleName, "" ) );
-					mangleName << "_";
+					mangleName += std::to_string( dcount ) + "_" + std::to_string( fcount ) + "_" + std::to_string( vcount ) + "_" + std::to_string( acount ) + "_";
+					for(const auto & a : assertionNames) mangleName += a;
+//					std::copy( assertionNames.begin(), assertionNames.end(), std::ostream_iterator< std::string >( mangleName, "" ) );
+					mangleName += "_";
 				} // if
 			} // if
@@ -701,19 +703,19 @@
 				// these qualifiers do not distinguish the outermost type of a function parameter
 				if ( type->is_const() ) {
-					mangleName << Encoding::qualifiers.at(Type::Const);
+					mangleName += Encoding::qualifiers.at(Type::Const);
 				} // if
 				if ( type->is_volatile() ) {
-					mangleName << Encoding::qualifiers.at(Type::Volatile);
+					mangleName += Encoding::qualifiers.at(Type::Volatile);
 				} // if
 				// Removed due to restrict not affecting function compatibility in GCC
 				// if ( type->get_isRestrict() ) {
-				// 	mangleName << "E";
+				// 	mangleName += "E";
 				// } // if
 				if ( type->is_atomic() ) {
-					mangleName << Encoding::qualifiers.at(Type::Atomic);
+					mangleName += Encoding::qualifiers.at(Type::Atomic);
 				} // if
 			}
 			if ( type->is_mutex() ) {
-				mangleName << Encoding::qualifiers.at(Type::Mutex);
+				mangleName += Encoding::qualifiers.at(Type::Mutex);
 			} // if
 			if ( inFunctionType ) {
