Index: doc/LaTeXmacros/common.tex
===================================================================
--- doc/LaTeXmacros/common.tex	(revision 9ff83109de15ee85befb018efad63d43144de47b)
+++ doc/LaTeXmacros/common.tex	(revision 22634b26cbd6509a73698339709810102f49ce46)
@@ -11,6 +11,6 @@
 %% Created On       : Sat Apr  9 10:06:17 2016
 %% Last Modified By : Peter A. Buhr
-%% Last Modified On : Sun May 14 18:17:09 2017
-%% Update Count     : 295
+%% Last Modified On : Mon May 15 18:03:29 2017
+%% Update Count     : 302
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -36,12 +36,12 @@
 % Names used in the document.
 
-\newcommand{\CFA}{C\raisebox{\depth}{\rotatebox{180}{\textscale{1.05}{\textsf{A}}}}\xspace} % Cforall symbolic name
-\newcommand{\CFL}{Cforall\xspace} % Cforall symbolic name
-\newcommand{\Celeven}{C11\xspace} % C11 symbolic name
-\newcommand{\CC}{\rm C\kern-.1em\hbox{+\kern-.25em+}\xspace} % C++ symbolic name
-\newcommand{\CCeleven}{\rm C\kern-.1em\hbox{+\kern-.25em+}11\xspace} % C++11 symbolic name
-\newcommand{\CCfourteen}{\rm C\kern-.1em\hbox{+\kern-.25em+}14\xspace} % C++14 symbolic name
-\newcommand{\CCseventeen}{\rm C\kern-.1em\hbox{+\kern-.25em+}17\xspace} % C++17 symbolic name
-\newcommand{\CCtwenty}{\rm C\kern-.1em\hbox{+\kern-.25em+}20\xspace} % C++20 symbolic name
+\newcommand{\CFA}{\textrm{C}\raisebox{\depth}{\rotatebox{180}{\textsf{A}}}\xspace} % Cforall symbolic name
+\newcommand{\CFL}{\textrm{Cforall}\xspace} % Cforall symbolic name
+\newcommand{\Celeven}{\textrm{C11}\xspace} % C11 symbolic name
+\newcommand{\CC}{\textrm{C}\kern-.1em\hbox{+\kern-.25em+}\xspace} % C++ symbolic name
+\newcommand{\CCeleven}{\textrm{C}\kern-.1em\hbox{+\kern-.25em+}11\xspace} % C++11 symbolic name
+\newcommand{\CCfourteen}{\textrm{C}\kern-.1em\hbox{+\kern-.25em+}14\xspace} % C++14 symbolic name
+\newcommand{\CCseventeen}{\textrm{C}\kern-.1em\hbox{+\kern-.25em+}17\xspace} % C++17 symbolic name
+\newcommand{\CCtwenty}{\textrm{C}\kern-.1em\hbox{+\kern-.25em+}20\xspace} % C++20 symbolic name
 \newcommand{\Csharp}{C\raisebox{-0.7ex}{\Large$^\sharp$}\xspace} % C# symbolic name
 
@@ -243,5 +243,6 @@
 literate={-}{\makebox[1ex][c]{\raisebox{0.4ex}{\rule{0.8ex}{0.075ex}}}}1 {^}{\raisebox{0.6ex}{$\scriptscriptstyle\land\,$}}1
 	{~}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}}1 {`}{\ttfamily\upshape\hspace*{-0.1ex}`}1
-	{<-}{$\leftarrow$}2 {=>}{$\Rightarrow$}2 {->}{\makebox[1ex][c]{\raisebox{0.4ex}{\rule{0.8ex}{0.075ex}}}\kern-0.2ex\textgreater}2,
+	{__}{\_\,\_}2 {<-}{$\leftarrow$}2 {=>}{$\Rightarrow$}2 {->}{\makebox[1ex][c]{\raisebox{0.4ex}{\rule{0.8ex}{0.075ex}}}\kern-0.2ex\textgreater}2
+	{___}{\_\,\_\,\_}3,
 moredelim=**[is][\color{red}]{®}{®},					% red highlighting ®...® (registered trademark symbol) emacs: C-q M-.
 moredelim=**[is][\color{blue}]{ß}{ß},					% blue highlighting ß...ß (sharp s symbol) emacs: C-q M-_
Index: doc/user/user.tex
===================================================================
--- doc/user/user.tex	(revision 9ff83109de15ee85befb018efad63d43144de47b)
+++ doc/user/user.tex	(revision 22634b26cbd6509a73698339709810102f49ce46)
@@ -11,6 +11,6 @@
 %% Created On       : Wed Apr  6 14:53:29 2016
 %% Last Modified By : Peter A. Buhr
-%% Last Modified On : Tue Apr 18 17:17:24 2017
-%% Update Count     : 1430
+%% Last Modified On : Mon May 15 18:29:58 2017
+%% Update Count     : 1598
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -35,5 +35,4 @@
 \usepackage{calc}
 \usepackage{xspace}
-\usepackage{graphicx}
 \usepackage{varioref}									% extended references
 \usepackage{listings}									% format program code
@@ -135,9 +134,9 @@
 \section{Introduction}
 
-\CFA\footnote{Pronounced ``C-for-all'', and written \CFA, CFA, or \CFL.} is a modern general-purpose programming-language, designed as an evolutionary step forward from the C programming language.
+\CFA{}\index{cforall@\CFA}\footnote{Pronounced ``\Index*{C-for-all}'', and written \CFA, CFA, or \CFL.} is a modern general-purpose programming-language, designed as an evolutionary step forward for the C programming language.
 The syntax of the \CFA language builds from C, and should look immediately familiar to C/\Index*[C++]{\CC} programmers.
 % Any language feature that is not described here can be assumed to be using the standard C11 syntax.
-\CFA adds many modern programming-language features that directly lead to increased \emph{safety} and \emph{productivity}, while maintaining interoperability with existing C programs and achieving C performance.
-Like C, \CFA is a statically typed, procedural language with a low-overhead runtime, meaning there is no global garbage-collection.
+\CFA adds many modern programming-language features that directly lead to increased \emph{\Index{safety}} and \emph{\Index{productivity}}, while maintaining interoperability with existing C programs and achieving C performance.
+Like C, \CFA is a statically typed, procedural language with a low-overhead runtime, meaning there is no global \Index{garbage-collection}, but \Index{regional garbage-collection}\index{garbage collection!regional} is possible.
 The primary new features include parametric-polymorphic routines and types, exceptions, concurrency, and modules.
 
@@ -148,14 +147,15 @@
 instead, a programmer evolves an existing C program into \CFA by incrementally incorporating \CFA features.
 New programs can be written in \CFA using a combination of C and \CFA features.
-\Index*[C++]{\CC} had a similar goal 30 years ago, but has struggled over the intervening time to incorporate modern programming-language features because of early design choices.
-\CFA has 30 years of hindsight and a clean starting point.
+\Index*[C++]{\CC} had a similar goal 30 years ago, but currently has the disadvantages of multiple legacy design-choices that cannot be updated and active divergence of the language model from C, requiring significant effort and training to incrementally add \CC to a C-based project.
+In contrast, \CFA has 30 years of hindsight and a clean starting point.
 
 Like \Index*[C++]{\CC}, there may be both an old and new ways to achieve the same effect.
 For example, the following programs compare the \CFA and C I/O mechanisms.
 \begin{quote2}
-\begin{tabular}{@{}l@{\hspace{3em}}l@{}}
-\multicolumn{1}{c@{\hspace{3em}}}{\textbf{\CFA}}	& \multicolumn{1}{c}{\textbf{C}}	\\
+\begin{tabular}{@{}l@{\hspace{1.5em}}l@{\hspace{1.5em}}l@{}}
+\multicolumn{1}{c@{\hspace{1.5em}}}{\textbf{\CFA}}	& \multicolumn{1}{c}{\textbf{C}}	& \multicolumn{1}{c}{\textbf{\CC}}	\\
 \begin{cfa}
 #include <fstream>
+
 int main( void ) {
 	int x = 0, y = 1, z = 2;
@@ -166,4 +166,5 @@
 \begin{lstlisting}
 #include <stdio.h>
+
 int main( void ) {
 	int x = 0, y = 1, z = 2;
@@ -171,8 +172,17 @@
 }
 \end{lstlisting}
+&
+\begin{lstlisting}
+#include <iostream>
+using namespace std;
+int main() {
+	int x = 0, y = 1, z = 2;
+	®cout<<x<<" "<<y<<" "<<z<<endl;®
+}
+\end{lstlisting}
 \end{tabular}
 \end{quote2}
-Both programs output the same result.
-While the \CFA I/O looks similar to the \Index*[C++]{\CC} output style, there are important differences, such as automatic spacing between variables as in \Index*{Python} (see also~\VRef{s:IOLibrary}).
+The programs output the same result.
+While the \CFA I/O looks similar to the \Index*[C++]{\CC} output style, there are important differences, such as automatic spacing between variables as in \Index*{Python} (see~\VRef{s:IOLibrary}).
 
 This document is a user manual for the \CFA programming language, targeted at \CFA programmers.
@@ -180,22 +190,13 @@
 In its current state, this document covers the intended core features of the language.
 Changes to the syntax and additional features are expected to be included in later revisions.
-% For additional information, see \url{http://wiki.do-lang.org}.
-
-
-\section{History}
-
-The \CFA project started with K-W C~\cite{Buhr94a,Till89}, which extended C with new declaration syntax, multiple return values from routines, and extended assignment capabilities using the notion of tuples.
-(See~\cite{Werther96} for some similar work, but for \Index*[C++]{\CC}.)
-The original \CFA project~\cite{Ditchfield92} extended the C type system with parametric polymorphism and overloading, as opposed to the \Index*[C++]{\CC} approach of object-oriented extensions to the C type-system.
-A first implementation of the core Cforall language was created~\cite{Bilson03,Esteves04}, but at the time there was little interesting in extending C, so work did not continue.
-As the saying goes, ``What goes around, comes around.'', and there is now renewed interest in the C programming language because of legacy code-bases, so the \CFA project has been restarted.
 
 
 \section{Why fix C?}
 
-Even with all its problems, C is a very popular programming language because it allows writing software at virtually any level in a computer system without restriction.
+The C programming language is a foundational technology for modern computing with millions of lines of code implementing everything from commercial operating-systems (especially UNIX systems) to hobby projects.
+This installation base and the programmers producing it represent a massive software-engineering investment spanning decades and likely to continue for decades more.
+Even with all its problems, C continues to be popular because it allows writing software at virtually any level in a computer system without restriction.
 For system programming, where direct access to hardware and dealing with real-time issues is a requirement, C is usually the language of choice.
-As well, there are millions of lines of C legacy code, forming the base for many software development projects (especially on UNIX systems).
-The TIOBE index (\url{http://www.tiobe.com/tiobe_index}) for March 2016 shows programming-language popularity, with \Index*{Java} 20.5\%, C 14.5\%, \Index*[C++]{\CC} 6.7\%, \Csharp 4.3\%, \Index*{Python} 4.3\%, and all other programming languages below 3\%.
+The TIOBE index~\cite{TIOBE} for March 2016 showed the following programming-language popularity: \Index*{Java} 20.5\%, C 14.5\%, \Index*[C++]{\CC} 6.7\%, \Csharp 4.3\%, \Index*{Python} 4.3\%, where the next 50 languages are less than 3\% each with a long tail.
 As well, for 30 years, C has been the number 1 and 2 most popular programming language:
 \begin{center}
@@ -211,9 +212,9 @@
 \end{tabular}
 \end{center}
-Hence, C is still an extremely important programming language, with double the usage of \Index*[C++]{\CC}, where \CC itself is largely C code.
-Finally, love it or hate it, C has been an important and influential part of computer science for 40 years and it appears it will continue to be for many more years.
+Hence, C is still an extremely important programming language, with double the usage of \Index*[C++]{\CC{}}; in many cases, \CC is often used solely as a better C.
+Love it or hate it, C has been an important and influential part of computer science for 40 years and sit appeal is not diminishing.
 Unfortunately, C has too many problems and omissions to make it an acceptable programming language for modern needs.
 
-The goal of this project is to engineer modern language features into C in an evolutionary rather than revolutionary way.
+As stated, the goal of the \CFA project is to engineer modern language features into C in an evolutionary rather than revolutionary way.
 \CC~\cite{c++,ANSI14:C++} is an example of a similar project;
 however, it largely extended the language, and did not address many existing problems.\footnote{%
@@ -225,10 +226,26 @@
 These costs can be prohibitive for many companies with a large software base in C/\CC, and a significant number of programmers requiring retraining to a new programming language.
 
-The result of this project is a language that is largely backwards compatible with C11~\cite{C11}, but fixing some of the well known C problems and containing many modern language features.
+The result of this project is a language that is largely backwards compatible with \Index*{C11}~\cite{C11}, but fixing some of the well known C problems and containing many modern language features.
 Without significant extension to the C programming language, it is becoming unable to cope with the needs of modern programming problems and programmers;
 as a result, it will fade into disuse.
 Considering the large body of existing C code and programmers, there is significant impetus to ensure C is transformed into a modern programming language.
-While C11 made a few simple extensions to the language, nothing was added to address existing problems in the language or to augment the language with modern language features.
+While \Index*{C11} made a few simple extensions to the language, nothing was added to address existing problems in the language or to augment the language with modern language features.
 While some may argue that modern language features may make C complex and inefficient, it is clear a language without modern capabilities is insufficient for the advanced programming problems existing today.
+
+
+\section{History}
+
+The \CFA project started with \Index*{K-W C}~\cite{Buhr94a,Till89}, which extended C with new declaration syntax, multiple return values from routines, and extended assignment capabilities using the notion of tuples.
+(See~\cite{Werther96} for similar work in \Index*[C++]{\CC{}}.)
+A first \CFA implementation of these extensions was by Esteves~\cite{Esteves04}.
+The signature feature of \CFA is parametric-polymorphic functions~\cite{forceone:impl,Cormack90,Duggan96} with functions generalized using a ©forall© clause (giving the language its name):
+\begin{lstlisting}
+®forall( otype T )® T identity( T val ) { return val; }
+int forty_two = identity( 42 );			§\C{// T is bound to int, forty\_two == 42}§
+\end{lstlisting}
+% extending the C type system with parametric polymorphism and overloading, as opposed to the \Index*[C++]{\CC} approach of object-oriented extensions.
+\CFA{}\hspace{1pt}'s polymorphism was originally formalized by Ditchfiled~\cite{Ditchfield92}, and first implemented by Bilson~\cite{Bilson03}.
+However, at that time, there was little interesting in extending C, so work did not continue.
+As the saying goes, ``What goes around, comes around.'', and there is now renewed interest in the C programming language because of legacy code-bases, so the \CFA project has been restarted.
 
 
@@ -236,11 +253,51 @@
 \label{s:Interoperability}
 
-\CFA is designed to integrate well with existing C programs and libraries.
-The most important feature of interoperability is to use the same calling conventions, so there is no overhead to call existing C routines.
-This feature allows users of \CFA to take advantage of the existing panoply of C libraries from inside their \CFA code.
-In fact, one of the biggest issues for any new programming language is establishing a minimum level of library code to support a large body of activities.
-Language developers often state that adequate library support takes more work than designing and implementing the language itself.
-Like \Index*[C++]{\CC}, \CFA starts with immediate access to all exiting C libraries, and in many cases, can easily wrap library routines with simpler and safer interfaces, at very low cost.
+\CFA is designed to integrate directly with existing C programs and libraries.
+The most important feature of \Index{interoperability} is using the same \Index{calling convention}s, so there is no overhead to call existing C routines.
+This feature allows \CFA programmers to take advantage of the existing panoply of C libraries to access thousands of external software features.
+Language developers often state that adequate \Index{library support} takes more work than designing and implementing the language itself.
+Fortunately, \CFA, like \Index*[C++]{\CC{}}, starts with immediate access to all exiting C libraries, and in many cases, can easily wrap library routines with simpler and safer interfaces, at very low cost.
 Hence, \CFA begins by leveraging the large repository of C libraries with little cost.
+
+\begin{comment}
+A simple example is leveraging the existing type-unsafe (©void *©) C ©bsearch© to binary search a sorted floating-point array:
+\begin{lstlisting}
+void * bsearch( const void * key, const void * base, size_t nmemb, size_t size,
+				int (* compar)( const void *, const void * ));
+
+int comp( const void * t1, const void * t2 ) { return *(double *)t1 < *(double *)t2 ? -1 :
+				*(double *)t2 < *(double *)t1 ? 1 : 0; }
+
+double key = 5.0, vals[10] = { /* 10 sorted floating-point values */ };
+double * val = (double *)bsearch( &key, vals, 10, sizeof(vals[0]), comp );	$\C{// search sorted array}$
+\end{lstlisting}
+which can be augmented simply with a polymorphic, type-safe, \CFA-overloaded wrappers:
+\begin{lstlisting}
+forall( otype T | { int ?<?( T, T ); } ) T * bsearch( T key, const T * arr, size_t size ) {
+	int comp( const void * t1, const void * t2 ) { /* as above with double changed to T */ }
+	return (T *)bsearch( &key, arr, size, sizeof(T), comp ); }
+
+forall( otype T | { int ?<?( T, T ); } ) unsigned int bsearch( T key, const T * arr, size_t size ) {
+	T * result = bsearch( key, arr, size );	$\C{// call first version}$
+	return result ? result - arr : size; }	$\C{// pointer subtraction includes sizeof(T)}$
+
+double * val = bsearch( 5.0, vals, 10 );	$\C{// selection based on return type}$
+int posn = bsearch( 5.0, vals, 10 );
+\end{lstlisting}
+The nested function ©comp© provides the hidden interface from typed \CFA to untyped (©void *©) C, plus the cast of the result.
+Providing a hidden ©comp© function in \CC is awkward as lambdas do not use C calling-conventions and template declarations cannot appear at block scope.
+As well, an alternate kind of return is made available: position versus pointer to found element.
+\CC's type-system cannot disambiguate between the two versions of ©bsearch© because it does not use the return type in overload resolution, nor can \CC separately compile a templated ©bsearch©.
+
+\CFA has replacement libraries condensing hundreds of existing C functions into tens of \CFA overloaded functions, all without rewriting the actual computations.
+For example, it is possible to write a type-safe \CFA wrapper ©malloc© based on the C ©malloc©:
+\begin{lstlisting}
+forall( dtype T | sized(T) ) T * malloc( void ) { return (T *)malloc( sizeof(T) ); }
+int * ip = malloc();					§\C{// select type and size from left-hand side}§
+double * dp = malloc();
+struct S {...} * sp = malloc();
+\end{lstlisting}
+where the return type supplies the type/size of the allocation, which is impossible in most type systems.
+\end{comment}
 
 However, it is necessary to differentiate between C and \CFA code because of name overloading, as for \CC.
@@ -250,5 +307,5 @@
 char abs( char );
 ®extern "C" {®
-int abs( int );					§\C{// use default C routine for int}§
+int abs( int );							§\C{// use default C routine for int}§
 ®}® // extern "C"
 long int abs( long int );
@@ -356,7 +413,7 @@
 \begin{cfa}
 #ifndef __CFORALL__
-#include <stdio.h>				§\C{// C header file}§
+#include <stdio.h>						§\C{// C header file}§
 #else
-#include <fstream>				§\C{// \CFA header file}§
+#include <fstream>						§\C{// \CFA header file}§
 #endif
 \end{cfa}
@@ -368,14 +425,14 @@
 Numeric constants are extended to allow \Index{underscore}s within constants\index{constant!underscore}, \eg:
 \begin{cfa}
-2®_®147®_®483®_®648;			§\C{// decimal constant}§
-56_ul;							§\C{// decimal unsigned long constant}§
-0_377;							§\C{// octal constant}§
-0x_ff_ff;						§\C{// hexadecimal constant}§
-0x_ef3d_aa5c;					§\C{// hexadecimal constant}§
-3.141_592_654;					§\C{// floating point constant}§
-10_e_+1_00;						§\C{// floating point constant}§
-0x_ff_ff_p_3;					§\C{// hexadecimal floating point}§
-0x_1.ffff_ffff_p_128_l;			§\C{// hexadecimal floating point long constant}§
-L_"\x_ff_ee";					§\C{// wide character constant}§
+2®_®147®_®483®_®648;					§\C{// decimal constant}§
+56®_®ul;								§\C{// decimal unsigned long constant}§
+0®_®377;								§\C{// octal constant}§
+0x®_®ff®_®ff;							§\C{// hexadecimal constant}§
+0x®_®ef3d®_®aa5c;						§\C{// hexadecimal constant}§
+3.141®_®592®_®654;						§\C{// floating point constant}§
+10®_®e®_®+1®_®00;						§\C{// floating point constant}§
+0x®_®ff®_®ff®_®p®_®3;					§\C{// hexadecimal floating point}§
+0x®_®1.ffff®_®ffff®_®p®_®128®_®l;		§\C{// hexadecimal floating point long constant}§
+L®_®§"\texttt{\textbackslash{x}}§®_®§\texttt{ff}§®_®§\texttt{ee}"§;	§\C{// wide character constant}§
 \end{cfa}
 The rules for placement of underscores is as follows:
@@ -401,11 +458,13 @@
 \label{s:BackquoteIdentifiers}
 
-\CFA accommodates keyword clashes by syntactic transformations using the \CFA backquote escape-mechanism:
+\CFA accommodates keyword clashes with existing C variable-names by syntactic transformations using the \CFA backquote escape-mechanism:
 \begin{cfa}
 int ®`®otype®`® = 3;			§\C{// make keyword an identifier}§
 double ®`®choose®`® = 3.5;
 \end{cfa}
-Programs can be converted easily by enclosing keyword identifiers in backquotes, and the backquotes can be removed later when the identifier name is changed to an non-keyword name.
-Clashes in C header files (see~\VRef{s:StandardHeaders}) can be handled automatically using the preprocessor, ©#include_next© and ©-I filename©:
+Programs can be converted easily by enclosing keyword identifiers in backquotes, and the backquotes can be removed later when the identifier name is changed to a  non-keyword name.
+\VRef[Figure]{f:InterpositionHeaderFile} shows how clashes in C header files (see~\VRef{s:StandardHeaders}) can be handled using preprocessor \newterm{interposition}: ©#include_next© and ©-I filename©:
+
+\begin{figure}
 \begin{cfa}
 // include file uses the CFA keyword "otype".
@@ -422,4 +481,7 @@
 #endif // otype && __CFA_BFD_H__
 \end{cfa}
+\caption{Interposition of Header File}
+\label{f:InterpositionHeaderFile}
+\end{figure}
 
 
@@ -446,5 +508,5 @@
 ... (*f())[3] += 1;
 \end{cfa}
-Essentially, the return type is wrapped around the routine name in successive layers (like an onion).
+Essentially, the return type is wrapped around the routine name in successive layers (like an \Index{onion}).
 While attempting to make the two contexts consistent is a laudable goal, it has not worked out in practice.
 
@@ -2011,4 +2073,224 @@
 So the type raised would be the mangled name of the exception prototype and that name would be matched at the handler clauses by comparing the strings.
 The arguments for the call would have to be packed in a message and unpacked at handler clause and then a call made to the handler.
+
+
+\section{I/O Library}
+\label{s:IOLibrary}
+\index{input/output library}
+
+The goal for the \CFA I/O is to make I/O as simple as possible in the common cases, while fully supporting polymorphism and user defined types in a consistent way.
+The common case is printing out a sequence of variables separated by whitespace.
+\begin{quote2}
+\begin{tabular}{@{}l@{\hspace{3em}}l@{}}
+\multicolumn{1}{c@{\hspace{3em}}}{\textbf{\CFA}}	& \multicolumn{1}{c}{\textbf{\CC}}	\\
+\begin{cfa}
+int x = 0, y = 1, z = 2;
+sout | x ®|® y ®|® z | endl;
+\end{cfa}
+&
+\begin{cfa}
+
+cout << x ®<< " "® << y ®<< " "® << z << endl;
+\end{cfa}
+\end{tabular}
+\end{quote2}
+The \CFA form has half as many characters as the \CC form, and is similar to \Index*{Python} I/O with respect to implicit separators.
+
+The logical-or operator is used because it is the lowest-priority overloadable operator, other than assignment.
+Therefore, fewer output expressions require parenthesis.
+\begin{quote2}
+\begin{tabular}{@{}ll@{}}
+\textbf{\CFA:}
+&
+\begin{cfa}
+sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2) | endl;
+\end{cfa}
+\\
+\textbf{\CC:}
+&
+\begin{cfa}
+cout << x * 3 << y + 1 << (z << 2) << (x == y) << (x | y) << (x || y) << (x > z ? 1 : 2) << endl;
+\end{cfa}
+\end{tabular}
+\end{quote2}
+Finally, the logical-or operator has a link with the Shell pipe-operator for moving data, where data flows in the correct direction for input but the opposite direction for output.
+
+The implicit separator\index{I/O separator} character (space/blank) is a separator not a terminator.
+The rules for implicitly adding the separator are:
+\begin{enumerate}
+\item
+A separator does not appear at the start or end of a line.
+\begin{cfa}[belowskip=0pt]
+sout | 1 | 2 | 3 | endl;
+\end{cfa}
+\begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
+1 2 3
+\end{cfa}
+\item
+A separator does not appear before or after a character literal or variable.
+\begin{cfa}
+sout | '1' | '2' | '3' | endl;
+123
+\end{cfa}
+\item
+A separator does not appear before or after a null (empty) C string
+\begin{cfa}
+sout | 1 | "" | 2 | "" | 3 | endl;
+123
+\end{cfa}
+which is a local mechanism to disable insertion of the separator character.
+\item
+A separator does not appear before a C string starting with the (extended) \Index{ASCII}\index{ASCII!extended} characters: \lstinline[mathescape=off]@([{=$£¥¡¿«@
+%$
+\begin{cfa}[mathescape=off]
+sout | "x (" | 1 | "x [" | 2 | "x {" | 3 | "x =" | 4 | "x $" | 5 | "x £" | 6 | "x ¥"
+		| 7 | "x ¡" | 8 | "x ¿" | 9 | "x «" | 10 | endl;
+\end{cfa}
+%$
+\begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
+x (1 x [2 x {3 x =4 x $5 x £6 x ¥7 x ¡8 x ¿9 x «10
+\end{cfa}
+%$
+\item
+{\lstset{language=CFA,deletedelim=**[is][]{¢}{¢}}
+A seperator does not appear after a C string ending with the (extended) \Index{ASCII}\index{ASCII!extended} characters: ©,.;!?)]}%¢»©
+\begin{cfa}[belowskip=0pt]
+sout | 1 | ", x" | 2 | ". x" | 3 | "; x" | 4 | "! x" | 5 | "? x" | 6 | "% x"
+		| 7 | "¢ x" | 8 | "» x" | 9 | ") x" | 10 | "] x" | 11 | "} x" | endl;
+\end{cfa}
+\begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
+1, x 2. x 3; x 4! x 5? x 6% x 7§\textcent§ x 8» x 9) x 10] x 11} x
+\end{cfa}}%
+\item
+A seperator does not appear before or after a C string begining/ending with the \Index{ASCII} quote or whitespace characters: \lstinline[showspaces=true]@`'": \t\v\f\r\n@
+\begin{cfa}[belowskip=0pt]
+sout | "x`" | 1 | "`x'" | 2 | "'x\"" | 3 | "\"x:" | 4 | ":x " | 5 | " x\t" | 6 | "\tx" | endl;
+\end{cfa}
+\begin{cfa}[mathescape=off,showspaces=true,showtabs=true,aboveskip=0pt,belowskip=0pt]
+x`1`x'2'x"3"x:4:x 5 x	6	x
+\end{cfa}
+\end{enumerate}
+
+The following \CC-style \Index{manipulator}s allow control over implicit seperation.
+Manipulators \Indexc{sepOn}\index{manipulator!sepOn@©sepOn©} and \Indexc{sepOff}\index{manipulator!sepOff@©sepOff©} \emph{locally} toggle printing the separator, i.e., the seperator is adjusted only with respect to the next printed item.
+\begin{cfa}[mathescape=off,belowskip=0pt]
+sout | sepOn | 1 | 2 | 3 | sepOn | endl;	§\C{// separator at start of line}§
+\end{cfa}
+\begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
+ 1 2 3
+\end{cfa}
+\begin{cfa}[mathescape=off,aboveskip=0pt,belowskip=0pt]
+sout | 1 | sepOff | 2 | 3 | endl;			§\C{// locally turn off implicit separator}§
+\end{cfa}
+\begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
+12 3
+\end{cfa}
+Manipulators \Indexc{sepDisable}\index{manipulator!sepDisable@©sepDisable©} and \Indexc{sepEnable}\index{manipulator!sepEnable@©sepEnable©} \emph{globally} toggle printing the separator, i.e., the seperator is adjusted with respect to all subsequent printed items, unless locally adjusted.
+\begin{cfa}[mathescape=off,aboveskip=0pt,belowskip=0pt]
+sout | sepDisable | 1 | 2 | 3 | endl;		§\C{// globally turn off implicit separation}§
+\end{cfa}
+\begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
+123
+\end{cfa}
+\begin{cfa}[mathescape=off,aboveskip=0pt,belowskip=0pt]
+sout | 1 | sepOn | 2 | 3 | endl;			§\C{// locally turn on implicit separator}§
+\end{cfa}
+\begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
+1 23
+\end{cfa}
+\begin{cfa}[mathescape=off,aboveskip=0pt,belowskip=0pt]
+sout | sepEnable | 1 | 2 | 3 | endl;		§\C{// globally turn on implicit separation}§
+\end{cfa}
+\begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
+1 2 3
+\end{cfa}
+Printing a tuple outputs all the tuple's values separated by ©", "©:
+\begin{cfa}[mathescape=off,aboveskip=0pt,belowskip=0pt]
+sout | [2, 3] | [4, 5] | endl;				§\C{// print tuple}§
+\end{cfa}
+\begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
+2, 3, 4, 5
+\end{cfa}
+The tuple separator can also be turned on and off:
+\begin{cfa}[mathescape=off,aboveskip=0pt,belowskip=0pt]
+sout | sepOn | [2, 3] | sepOff | [4, 5] | endl;	§\C{// locally turn on/off implicit separation}§
+\end{cfa}
+\begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
+, 2, 34, 5
+\end{cfa}
+Notice a tuple seperator starts the line because the next item is a tuple.
+Finally, the stream routines \Indexc{sepGet}\index{manipulator!sepGet@©sepGet©} and \Indexc{sepSet}\index{manipulator!sepSet@©sepSet©} get and set the basic separator-string.
+\begin{cfa}[mathescape=off,aboveskip=0pt,aboveskip=0pt,belowskip=0pt]
+sepSet( sout, ", $" );						§\C{// set separator from " " to ", \$"}§
+sout | 1 | 2 | 3 | " \"" | sepGet( sout ) | "\"" | endl;
+\end{cfa}
+%$
+\begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt]
+1, $2, $3 ", $"
+\end{cfa}
+%$
+\begin{cfa}[mathescape=off,aboveskip=0pt,aboveskip=0pt,belowskip=0pt]
+sepSet( sout, " " );						§\C{// reset separator to " "}§
+sout | 1 | 2 | 3 | " \"" | sepGet( sout ) | "\"" | endl;
+\end{cfa}
+\begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt]
+1 2 3 " "
+\end{cfa}
+and the stream routines \Indexc{sepGetTuple}\index{manipulator!sepGetTuple@©sepGetTuple©} and \Indexc{sepSetTuple}\index{manipulator!sepSetTuple@©sepSetTuple©} get and set the tuple separator-string.
+\begin{cfa}[mathescape=off,aboveskip=0pt,aboveskip=0pt,belowskip=0pt]
+sepSetTuple( sout, " " );					§\C{// set tuple separator from ", " to " "}§
+sout | [2, 3] | [4, 5] | " \"" | sepGetTuple( sout ) | "\"" | endl;
+\end{cfa}
+\begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt]
+2 3 4 5 " "
+\end{cfa}
+\begin{cfa}[mathescape=off,aboveskip=0pt,aboveskip=0pt,belowskip=0pt]
+sepSetTuple( sout, ", " );					§\C{// reset tuple separator to ", "}§
+sout | [2, 3] | [4, 5] | " \"" | sepGetTuple( sout ) | "\"" | endl;
+\end{cfa}
+\begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt]
+2, 3, 4, 5 ", "
+\end{cfa}
+
+\begin{comment}
+#include <fstream>
+
+int main( void ) {
+	int x = 0, y = 1, z = 2;
+	sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2) | endl | endl;
+	sout | 1 | 2 | 3 | endl;
+	sout | '1' | '2' | '3' | endl;
+	sout | 1 | "" | 2 | "" | 3 | endl;
+	sout | "x (" | 1 | "x [" | 2 | "x {" | 3 | "x =" | 4 | "x $" | 5 | "x £" | 6 | "x ¥"
+		| 7 | "x ¡" | 8 | "x ¿" | 9 | "x «" | 10 | endl;
+	sout | 1 | ", x" | 2 | ". x" | 3 | "; x" | 4 | "! x" | 5 | "? x" | 6 | "% x"
+		| 7 | "¢ x" | 8 | "» x" | 9 | ") x" | 10 | "] x" | 11 | "} x" | endl;
+	sout | "x`" | 1 | "`x'" | 2 | "'x\"" | 3 | "\"x:" | 4 | ":x " | 5 | " x\t" | 6 | "\tx" | endl;
+
+	sout | sepOn | 1 | 2 | 3 | sepOn | endl;	// separator at start of line
+	sout | 1 | sepOff | 2 | 3 | endl;			// locally turn off implicit separator
+	sout | sepDisable | 1 | 2 | 3 | endl;		// globally turn off implicit separation
+	sout | 1 | sepOn | 2 | 3 | endl;			// locally turn on implicit separator
+	sout | sepEnable | 1 | 2 | 3 | endl;		// globally turn on implicit separation
+
+	sout | [2, 3] | [4, 5] | endl;				// print tuple
+	sout | sepOn | [2, 3] | sepOff | [4, 5] | endl;	// locally turn on/off implicit separation
+
+	sepSet( sout, ", $" );						// set separator from " " to ", $"
+	sout | 1 | 2 | 3 | " \"" | sepGet( sout ) | "\"" | endl;
+	sepSet( sout, " " );						// reset separator to " "
+	sout | 1 | 2 | 3 | " \"" | sepGet( sout ) | "\"" | endl;
+
+	sepSetTuple( sout, " " );					// set tuple separator from ", " to " "
+	sout | [2, 3] | [4, 5] | " \"" | sepGetTuple( sout ) | "\"" | endl;
+	sepSetTuple( sout, ", " );					// reset tuple separator to ", "
+	sout | [2, 3] | [4, 5] | " \"" | sepGetTuple( sout ) | "\"" | endl;
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
+\end{comment}
+%$
 
 
@@ -2416,5 +2698,5 @@
 \begin{quote2}
 \begin{tabular}{@{}l@{\hspace{3em}}ll@{}}
-\multicolumn{1}{c@{\hspace{3em}}}{\textbf{\CC}}	& \multicolumn{1}{c}{Indexc{gcc}} \\
+\multicolumn{1}{c@{\hspace{3em}}}{\textbf{\CC}}	& \multicolumn{1}{c}{\textbf{\Indexc{gcc}}} \\
 \begin{cfa}
 
@@ -2760,50 +3042,4 @@
 The exact set of unsafe C constructs that will be disallowed in \CFA has not yet been decided, but is sure to include pointer arithmetic, pointer casting, etc.
 Once the full set is decided, the rules will be listed here.
-
-
-\section{Syntactic Anomalies}
-
-The number 0 and 1 are treated specially in \CFA, and can be redefined as variables.
-One syntactic anomaly is when a field in an structure is names 0 or 1:
-\begin{cfa}
-struct S {
-	int 0, 1;
-} s;
-\end{cfa}
-The problem occurs in accessing these fields using the selection operation ``©.©'':
-\begin{cfa}
-s.0 = 0;	// ambiguity with floating constant .0
-s.1 = 1;	// ambiguity with floating constant .1
-\end{cfa}
-To make this work, a space is required after the field selection:
-\begin{cfa}
-®s.§\textvisiblespace§0® = 0;
-®s.§\textvisiblespace§1® = 1;
-\end{cfa}
-While this syntax is awkward, it is unlikely many programmers will name fields of a structure 0 or 1.
-Like the \Index*[C++]{\CC} lexical problem with closing template-syntax, e.g, ©Foo<Bar<int®>>®©, this issue can be solved with a more powerful lexer/parser.
-
-There are several ambiguous cases with operator identifiers, \eg ©int *?*?()©, where the string ©*?*?© can be lexed as ©*©/©?*?© or ©*?©/©*?©.
-Since it is common practise to put a unary operator juxtaposed to an identifier, \eg ©*i©, users will be annoyed if they cannot do this with respect to operator identifiers.
-Even with this special hack, there are 5 general cases that cannot be handled.
-The first case is for the function-call identifier ©?()©:
-\begin{cfa}
-int *§\textvisiblespace§?()();	// declaration: space required after '*'
-*§\textvisiblespace§?()();		// expression: space required after '*'
-\end{cfa}
-Without the space, the string ©*?()© is ambiguous without N character look ahead;
-it requires scanning ahead to determine if there is a ©'('©, which is the start of an argument/parameter list.
-
-The 4 remaining cases occur in expressions:
-\begin{cfa}
-i++§\textvisiblespace§?i:0;		// space required before '?'
-i--§\textvisiblespace§?i:0;		// space required before '?'
-i§\textvisiblespace§?++i:0;		// space required after '?'
-i§\textvisiblespace§?--i:0;		// space required after '?'
-\end{cfa}
-In the first two cases, the string ©i++?© is ambiguous, where this string can be lexed as ©i© / ©++?© or ©i++© / ©?©;
-it requires scanning ahead to determine if there is a ©'('©, which is the start of an argument list.
-In the second two cases, the string ©?++x© is ambiguous, where this string can be lexed as ©?++© / ©x© or ©?© / y©++x©;
-it requires scanning ahead to determine if there is a ©'('©, which is the start of an argument list.
 
 
@@ -4419,4 +4655,30 @@
 
 
+\section{Syntactic Anomalies}
+
+There are several ambiguous cases with operator identifiers, \eg ©int *?*?()©, where the string ©*?*?© can be lexed as ©*©~\R{/}~©?*?© or ©*?©~\R{/}~©*?©.
+Since it is common practise to put a unary operator juxtaposed to an identifier, \eg ©*i©, users will be annoyed if they cannot do this with respect to operator identifiers.
+Even with this special hack, there are 5 general cases that cannot be handled.
+The first case is for the function-call identifier ©?()©:
+\begin{cfa}
+int *§\textvisiblespace§?()();	// declaration: space required after '*'
+*§\textvisiblespace§?()();		// expression: space required after '*'
+\end{cfa}
+Without the space, the string ©*?()© is ambiguous without N character look ahead;
+it requires scanning ahead to determine if there is a ©'('©, which is the start of an argument/parameter list.
+
+The 4 remaining cases occur in expressions:
+\begin{cfa}
+i++§\textvisiblespace§?i:0;		// space required before '?'
+i--§\textvisiblespace§?i:0;		// space required before '?'
+i§\textvisiblespace§?++i:0;		// space required after '?'
+i§\textvisiblespace§?--i:0;		// space required after '?'
+\end{cfa}
+In the first two cases, the string ©i++?© is ambiguous, where this string can be lexed as ©i© / ©++?© or ©i++© / ©?©;
+it requires scanning ahead to determine if there is a ©'('©, which is the start of an argument list.
+In the second two cases, the string ©?++x© is ambiguous, where this string can be lexed as ©?++© / ©x© or ©?© / y©++x©;
+it requires scanning ahead to determine if there is a ©'('©, which is the start of an argument list.
+
+
 \section{Incompatible}
 
@@ -4555,15 +4817,41 @@
 
 
-\section{New Keywords}
-\label{s:NewKeywords}
+\section{\protect\CFA Keywords}
+\label{s:CFAKeywords}
 
 \begin{quote2}
 \begin{tabular}{lll}
-©catch©			& ©fallthrough©	& ©otype©		\\
-©catchResume©	& ©fallthru©	& ©throw©		\\
-©choose©		& ©finally©		& ©throwResume©	\\
-©disable©		& ©forall©		& ©trait©		\\
-©dtype©			& ©ftype©		& ©try©			\\
-©enable©		& ©lvalue©		&				\\
+\begin{tabular}{@{}l@{}}
+©_AT©			\\
+©catch©			\\
+©catchResume©	\\
+©choose©		\\
+©coroutine©		\\
+©disable©		\\
+©dtype©			\\
+©enable©		\\
+\end{tabular}
+&
+\begin{tabular}{@{}l@{}}
+©fallthrough©	\\
+©fallthru©		\\
+©finally©		\\
+©forall©		\\
+©ftype©			\\
+©lvalue©		\\
+©monitor©		\\
+©mutex©			\\
+\end{tabular}
+&
+\begin{tabular}{@{}l@{}}
+©one_t©			\\
+©otype©			\\
+©throw©			\\
+©throwResume©	\\
+©trait©			\\
+©try©			\\
+©ttype©			\\
+©zero_t©		\\
+\end{tabular}
 \end{tabular}
 \end{quote2}
@@ -4573,10 +4861,11 @@
 \label{s:StandardHeaders}
 
-C prescribes the following standard header-files~\cite[\S~7.1.2]{C11}:
+C11 prescribes the following standard header-files~\cite[\S~7.1.2]{C11} and \CFA adds to this list:
 \begin{quote2}
-\begin{minipage}{\linewidth}
-\begin{tabular}{lll}
-assert.h	& math.h		& stdlib.h		\\
-complex.h	& setjmp.h		& stdnoreturn.h	\\
+\begin{tabular}{lll|l}
+\multicolumn{3}{c|}{C11} & \multicolumn{1}{c}{\CFA}		\\
+\hline
+assert.h	& math.h		& stdlib.h		& unistd.h	\\
+complex.h	& setjmp.h		& stdnoreturn.h	& gmp.h		\\
 ctype.h		& signal.h		& string.h		\\
 errno.h		& stdalign.h	& tgmath.h		\\
@@ -4586,178 +4875,10 @@
 iso646.h	& stddef.h		& wchar.h		\\
 limits.h	& stdint.h		& wctype.h		\\
-locale.h	& stdio.h		& unistd.h\footnote{\CFA extension}
+locale.h	& stdio.h		&				\\
 \end{tabular}
-\end{minipage}
 \end{quote2}
 For the prescribed head-files, \CFA implicitly wraps their includes in an ©extern "C"©;
 hence, names in these include files are not mangled\index{mangling!name} (see~\VRef{s:Interoperability}).
 All other C header files must be explicitly wrapped in ©extern "C"© to prevent name mangling.
-
-
-\section{I/O Library}
-\label{s:IOLibrary}
-\index{input/output library}
-
-The goal for the \CFA I/O is to make I/O as simple as possible in the common cases, while fully supporting polymorphism and user defined types in a consistent way.
-The common case is printing out a sequence of variables separated by whitespace.
-\begin{quote2}
-\begin{tabular}{@{}l@{\hspace{3em}}l@{}}
-\multicolumn{1}{c@{\hspace{3em}}}{\textbf{\CFA}}	& \multicolumn{1}{c}{\textbf{\CC}}	\\
-\begin{cfa}
-int x = 0, y = 1, z = 2;
-®sout® ®|® x ®|® y ®|® z ®| endl®;
-\end{cfa}
-&
-\begin{cfa}
-
-cout << x << " " << y << " " << z << endl;
-\end{cfa}
-\end{tabular}
-\end{quote2}
-The \CFA form has half as many characters as the \CC form, and is similar to \Index*{Python} I/O with respect to implicit separators.
-
-The logical-or operator is used because it is the lowest-priority overloadable operator, other than assignment.
-Therefore, fewer output expressions require parenthesis.
-\begin{quote2}
-\begin{tabular}{@{}ll@{}}
-\textbf{\CFA:}
-&
-\begin{cfa}
-sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2) | endl;
-\end{cfa}
-\\
-\textbf{\CC:}
-&
-\begin{cfa}
-cout << x * 3 << y + 1 << (z << 2) << (x == y) << (x | y) << (x || y) << (x > z ? 1 : 2) << endl;
-\end{cfa}
-\end{tabular}
-\end{quote2}
-Finally, the logical-or operator has a link with the Shell pipe-operator for moving data, although data flows in the opposite direction.
-
-The implicit separator\index{I/O separator} character (space/blank) is a separator not a terminator.
-The rules for implicitly adding the separator are:
-\begin{enumerate}
-\item
-A separator does not appear at the start or end of a line.
-\begin{cfa}[belowskip=0pt]
-sout | 1 | 2 | 3 | endl;
-\end{cfa}
-\begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
-1 2 3
-\end{cfa}
-\item
-A separator does not appear before or after a character literal or variable.
-\begin{cfa}
-sout | '1' | '2' | '3' | endl;
-123
-\end{cfa}
-\item
-A separator does not appear before or after a null (empty) C string
-\begin{cfa}
-sout | 1 | "" | 2 | "" | 3 | endl;
-123
-\end{cfa}
-which is a local mechanism to disable insertion of the separator character.
-\item
-A separator does not appear before a C string starting with the (extended) \Index{ASCII}\index{ASCII!extended} characters: \lstinline[mathescape=off]@([{=$£¥¡¿«@
-%$
-\begin{cfa}[mathescape=off]
-sout | "x (" | 1 | "x [" | 2 | "x {" | 3 | "x =" | 4 | "x $" | 5 | "x £" | 6 | "x ¥" | 7
-	 | "x ¡" | 8 | "x ¿" | 9 | "x «" | 10 | endl;
-\end{cfa}
-%$
-\begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
-x (1 x [2 x {3 x =4 x $5 x £6 x ¥7 x ¡8 x ¿9 x «10
-\end{cfa}
-%$
-\item
-{\lstset{deletedelim=**[is][]{¢}{¢}}
-A seperator does not appear after a C string ending with the (extended) \Index{ASCII}\index{ASCII!extended} characters: ©,.:;!?)]}%¢»©
-\begin{cfa}[belowskip=0pt]
-sout | 1 | ", x" | 2 | ". x" | 3 | ": x" | 4 | "; x" | 5 | "! x" | 6 | "? x" | 7 | "% x"
-	 | 8 | "¢ x" | 9 | "» x" | 10 | ") x" | 11 | "] x" | 12 | "} x" | endl;
-\end{cfa}
-\begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
-1, x 2. x 3: x 4; x 5! x 6? x 7% x 8¢ x 9» x 10) x 11] x 12} x
-\end{cfa}}%
-\item
-A seperator does not appear before or after a C string begining/ending with the \Index{ASCII} quote or whitespace characters: \lstinline[showspaces=true]@`'" \t\v\f\r\n@
-\begin{cfa}[belowskip=0pt]
-sout | "x`" | 1 | "`x'" | 2 | "'x\"" | 3 | "\"x" | "x " | 4 | " x" | "x\t" | 1 | "\tx" | endl;
-\end{cfa}
-\begin{cfa}[mathescape=off,showspaces=true,showtabs=true,aboveskip=0pt,belowskip=0pt]
-x`1`x'2'x"3"x x 4 x x	1	x
-\end{cfa}
-\end{enumerate}
-The following \CC-style \Index{manipulator}s allow further control over implicit seperation.
-\begin{cfa}[mathescape=off,belowskip=0pt]
-sout | sepOn | 1 | 2 | 3 | sepOn | endl;	§\C{// separator at start of line}§
-\end{cfa}
-\begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
- 1 2 3
-\end{cfa}
-\begin{cfa}[mathescape=off,aboveskip=0pt,belowskip=0pt]
-sout | 1 | sepOff | 2 | 3 | endl;			§\C{// turn off implicit separator locally}§
-\end{cfa}
-\begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
-12 3
-\end{cfa}
-\begin{cfa}[mathescape=off,aboveskip=0pt,belowskip=0pt]
-sout | sepDisable | 1 | 2 | 3 | endl;		§\C{// turn off implicit separation globally}§
-\end{cfa}
-\begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
-123
-\end{cfa}
-\begin{cfa}[mathescape=off,aboveskip=0pt,belowskip=0pt]
-sout | 1 | sepOn | 2 | 3 | endl;			§\C{// turn on implicit separator locally}§
-\end{cfa}
-\begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
-1 23
-\end{cfa}
-\begin{cfa}[mathescape=off,aboveskip=0pt,belowskip=0pt]
-sout | sepEnable | 1 | 2 | 3 | endl;		§\C{// turn on implicit separation globally}§
-\end{cfa}
-\begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt]
- 1 2 3
-\end{cfa}
-\begin{cfa}[mathescape=off,aboveskip=0pt,aboveskip=0pt,belowskip=0pt]
-sepSet( sout, ", $" );						§\C{// change separator from " " to ", \$"}§
-sout | 1 | 2 | 3 | endl;
-\end{cfa}
-%$
-\begin{cfa}[mathescape=off,showspaces=true,aboveskip=0pt]
-1, $2, $3
-\end{cfa}
-%$
-\begin{comment}
-#include <fstream>
-
-int main() {
-	int x = 0, y = 1, z = 2;
-	sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2) | endl | endl;
-	sout | 1 | 2 | 3 | endl;
-	sout | '1' | '2' | '3' | endl;
-	sout | 1 | "" | 2 | "" | 3 | endl;
-	sout | "x (" | 1 | "x [" | 2 | "x {" | 3 | "x =" | 4 | "x $" | 5 | "x £" | 6 | "x ¥" | 7
-		| "x ¡" | 8 | "x ¿" | 9 | "x «" | 10 | endl;
-	sout | 1 | ", x" | 2 | ". x" | 3 | ": x" | 4 | "; x" | 5 | "! x" | 6 | "? x" | 7 | "% x"
-		| 8 | "¢ x" | 9 | "» x" | 10 | ") x" | 11 | "] x" | 12 | "} x" | endl;
-	sout | "x`" | 1 | "`x'" | 2 | "'x\"" | 3 | "\"x" | "x " | 4 | " x" | "x\t" | 1 | "\tx" | endl;
-	sout | sepOn | 1 | 2 | 3 | sepOn | endl;	// separator at start of line
-	sout | 1 | sepOff | 2 | 3 | endl;			// turn off implicit separator temporarily
-	sout | sepDisable | 1 | 2 | 3 | endl;		// turn off implicit separation, affects all subsequent prints
-	sout | 1 | sepOn | 2 | 3 | endl;			// turn on implicit separator temporarily
-	sout | sepEnable | 1 | 2 | 3 | endl;		// turn on implicit separation, affects all subsequent prints
-	sepSet( sout, ", $" );						// change separator from " " to ", $"
-	sout | 1 | 2 | 3 | endl;
-
-}
-
-// Local Variables: //
-// tab-width: 4 //
-// End: //
-\end{comment}
-%$
 
 
Index: src/libcfa/fstream
===================================================================
--- src/libcfa/fstream	(revision 9ff83109de15ee85befb018efad63d43144de47b)
+++ src/libcfa/fstream	(revision 22634b26cbd6509a73698339709810102f49ce46)
@@ -10,6 +10,6 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Mar 21 15:57:24 2017
-// Update Count     : 102
+// Last Modified On : Mon May 15 18:11:09 2017
+// Update Count     : 104
 //
 
@@ -29,17 +29,21 @@
 }; // ofstream
 
+// private
 _Bool sepPrt( ofstream * );
-void sepOn( ofstream * );
-void sepOff( ofstream * );
 void sepReset( ofstream * );
 void sepReset( ofstream *, _Bool );
 const char * sepGetCur( ofstream * );
 void sepSetCur( ofstream *, const char * );
+
+// public
+void sepOn( ofstream * );
+void sepOff( ofstream * );
+_Bool sepDisable( ofstream * );
+_Bool sepEnable( ofstream * );
+
 const char * sepGet( ofstream * );
 void sepSet( ofstream *, const char * );
 const char * sepGetTuple( ofstream * );
 void sepSetTuple( ofstream *, const char * );
-_Bool sepDisable( ofstream * );
-_Bool sepEnable( ofstream * );
 
 int fail( ofstream * );
Index: src/libcfa/fstream.c
===================================================================
--- src/libcfa/fstream.c	(revision 9ff83109de15ee85befb018efad63d43144de47b)
+++ src/libcfa/fstream.c	(revision 22634b26cbd6509a73698339709810102f49ce46)
@@ -10,6 +10,6 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Mar 23 08:20:41 2017
-// Update Count     : 226
+// Last Modified On : Mon May 15 18:11:11 2017
+// Update Count     : 234
 //
 
@@ -38,28 +38,14 @@
 }
 
+// private
 _Bool sepPrt( ofstream * os ) { return os->sepOnOff; }
+void sepReset( ofstream * os ) { os->sepOnOff = os->sepDefault; }
+void sepReset( ofstream * os, _Bool reset ) { os->sepDefault = reset; os->sepOnOff = os->sepDefault; }
+const char * sepGetCur( ofstream * os ) { return os->sepCur; }
+void sepSetCur( ofstream * os, const char * sepCur ) { os->sepCur = sepCur; }
+
+// public
 void sepOn( ofstream * os ) { os->sepOnOff = 1; }
 void sepOff( ofstream * os ) { os->sepOnOff = 0; }
-void sepReset( ofstream * os ) { os->sepOnOff = os->sepDefault; }
-void sepReset( ofstream * os, _Bool reset ) { os->sepDefault = reset; os->sepOnOff = os->sepDefault; }
-
-const char * sepGetCur( ofstream * os ) { return os->sepCur; }
-void sepSetCur( ofstream * os, const char * sepCur ) { os->sepCur = sepCur; }
-
-const char * sepGet( ofstream * os ) { return os->separator; }
-
-void sepSet( ofstream * os, const char * s ) {
-	assert( s );
-	strncpy( os->separator, s, separateSize - 1 );
-	os->separator[separateSize - 1] = '\0';
-} // sepSet
-
-const char * sepGetTuple( ofstream * os ) { return os->tupleSeparator; }
-
-void sepSetTuple( ofstream * os, const char * s ) {
-	assert( s );
-	strncpy( os->tupleSeparator, s, separateSize - 1 );
-	os->tupleSeparator[separateSize - 1] = '\0';
-} // sepSet
 
 _Bool sepDisable( ofstream *os ) {
@@ -73,7 +59,21 @@
 	_Bool temp = os->sepDefault;
 	os->sepDefault = true;
-	sepReset( os );
+	if ( os->sepOnOff ) sepReset( os );					// start of line ?
 	return temp;
 } // sepEnable
+
+const char * sepGet( ofstream * os ) { return os->separator; }
+void sepSet( ofstream * os, const char * s ) {
+	assert( s );
+	strncpy( os->separator, s, separateSize - 1 );
+	os->separator[separateSize - 1] = '\0';
+} // sepSet
+
+const char * sepGetTuple( ofstream * os ) { return os->tupleSeparator; }
+void sepSetTuple( ofstream * os, const char * s ) {
+	assert( s );
+	strncpy( os->tupleSeparator, s, separateSize - 1 );
+	os->tupleSeparator[separateSize - 1] = '\0';
+} // sepSet
 
 int fail( ofstream * os ) {
Index: src/libcfa/gmp
===================================================================
--- src/libcfa/gmp	(revision 9ff83109de15ee85befb018efad63d43144de47b)
+++ src/libcfa/gmp	(revision 22634b26cbd6509a73698339709810102f49ce46)
@@ -10,13 +10,11 @@
 // Created On       : Tue Apr 19 08:43:43 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sat May 13 22:52:26 2017
-// Update Count     : 8
-// 
-
-extern "C" {
+// Last Modified On : Sun May 14 23:47:36 2017
+// Update Count     : 9
+// 
+
 // https://gmplib.org/gmp-man-6.1.1.pdf
+
 #include <gmp.h>										// GNU multi-precise integers
-// some code for operators "/" and "%" taken from g++ gmpxx.h
-}
 #include <fstream>										// sout
 
@@ -146,4 +144,5 @@
 Int ?*=?( Int * lhs, unsigned long int rhs ) { return *lhs = *lhs * rhs; }
 
+// some code for operators "/" and "%" taken from g++ gmpxx.h
 Int ?/?( Int dividend, Int divisor ) { Int quotient; mpz_tdiv_q( quotient.mpz, dividend.mpz, divisor.mpz ); return quotient; }
 Int ?/?( Int dividend, unsigned long int divisor ) { Int quotient; mpz_tdiv_q_ui( quotient.mpz, dividend.mpz, divisor ); return quotient; }
Index: src/libcfa/iostream
===================================================================
--- src/libcfa/iostream	(revision 9ff83109de15ee85befb018efad63d43144de47b)
+++ src/libcfa/iostream	(revision 22634b26cbd6509a73698339709810102f49ce46)
@@ -10,6 +10,6 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Mar 21 15:57:29 2017
-// Update Count     : 104
+// Last Modified On : Mon May 15 18:08:44 2017
+// Update Count     : 105
 //
 
@@ -20,17 +20,20 @@
 
 trait ostream( dtype ostype ) {
+	// private
 	_Bool sepPrt( ostype * );							// return separator state (on/off)
-	void sepOn( ostype * );								// turn separator state on
-	void sepOff( ostype * );							// turn separator state off
 	void sepReset( ostype * );							// set separator state to default state
 	void sepReset( ostype *, _Bool );					// set separator and default state
 	const char * sepGetCur( ostype * );					// get current separator string
 	void sepSetCur( ostype *, const char * );			// set current separator string
+	// public
+	void sepOn( ostype * );								// turn separator state on
+	void sepOff( ostype * );							// turn separator state off
+	_Bool sepDisable( ostype * );						// set default state to off, and return previous state
+	_Bool sepEnable( ostype * );						// set default state to on, and return previous state
+
 	const char * sepGet( ostype * );					// get separator string
 	void sepSet( ostype *, const char * );				// set separator to string (15 character maximum)
 	const char * sepGetTuple( ostype * );				// get tuple separator string
 	void sepSetTuple( ostype *, const char * );			// set tuple separator to string (15 character maximum)
-	_Bool sepDisable( ostype * );						// set default state to off, and return previous state
-	_Bool sepEnable( ostype * );						// set default state to on, and return previous state
 
 	int fail( ostype * );
Index: src/libcfa/rational
===================================================================
--- src/libcfa/rational	(revision 9ff83109de15ee85befb018efad63d43144de47b)
+++ src/libcfa/rational	(revision 22634b26cbd6509a73698339709810102f49ce46)
@@ -12,6 +12,6 @@
 // Created On       : Wed Apr  6 17:56:25 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sun May 14 16:49:13 2017
-// Update Count     : 78
+// Last Modified On : Mon May 15 21:30:12 2017
+// Update Count     : 90
 //
 
@@ -128,8 +128,8 @@
 
 // conversion
-// forall ( otype RationalImpl | arithmetic( RationalImpl ) )
-// double widen( Rational(RationalImpl) r );
-// forall ( otype RationalImpl | arithmetic( RationalImpl ) )
-// Rational(RationalImpl) narrow( double f, RationalImpl md );
+forall ( otype RationalImpl | arithmetic( RationalImpl ) | { double convert( RationalImpl ); } )
+double widen( Rational(RationalImpl) r );
+forall ( otype RationalImpl | arithmetic( RationalImpl ) | { double convert( RationalImpl );  RationalImpl convert( double );} )
+Rational(RationalImpl) narrow( double f, RationalImpl md );
 
 // I/O
Index: src/libcfa/rational.c
===================================================================
--- src/libcfa/rational.c	(revision 9ff83109de15ee85befb018efad63d43144de47b)
+++ src/libcfa/rational.c	(revision 22634b26cbd6509a73698339709810102f49ce46)
@@ -10,6 +10,6 @@
 // Created On       : Wed Apr  6 17:54:28 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sun May 14 17:25:19 2017
-// Update Count     : 131
+// Last Modified On : Mon May 15 21:29:23 2017
+// Update Count     : 149
 // 
 
@@ -190,37 +190,37 @@
 // conversion
 
-// forall ( otype RationalImpl | arithmetic( RationalImpl ) )
-// double widen( Rational(RationalImpl) r ) {
-// 	return (double)r.numerator / (double)r.denominator;
-// } // widen
-
-// // http://www.ics.uci.edu/~eppstein/numth/frap.c
-// forall ( otype RationalImpl | arithmetic( RationalImpl ) )
-// Rational(RationalImpl) narrow( double f, RationalImpl md ) {
-// 	if ( md <= 1 ) {									// maximum fractional digits too small?
-// 		return (Rational(RationalImpl)){ f, 1};			// truncate fraction
-// 	} // if
-
-// 	// continued fraction coefficients
-// 	RationalImpl m00 = 1, m11 = 1, m01 = 0, m10 = 0;
-// 	RationalImpl ai, t;
-
-// 	// find terms until denom gets too big
-// 	for ( ;; ) {
-// 		ai = (RationalImpl)f;
-// 	  if ( ! (m10 * ai + m11 <= md) ) break;
-// 		t = m00 * ai + m01;
-// 		m01 = m00;
-// 		m00 = t;
-// 		t = m10 * ai + m11;
-// 		m11 = m10;
-// 		m10 = t;
-// 		t = (double)ai;
-// 	  if ( f == t ) break;								// prevent division by zero
-// 	  f = 1 / (f - (double)t);
-// 	  if ( f > (double)0x7FFFFFFF ) break;				// representation failure
-// 	} 
-// 	return (Rational(RationalImpl)){ m00, m10 };
-// } // narrow
+forall ( otype RationalImpl | arithmetic( RationalImpl ) | { double convert( RationalImpl ); } )
+double widen( Rational(RationalImpl) r ) {
+ 	return convert( r.numerator ) / convert( r.denominator );
+} // widen
+
+// http://www.ics.uci.edu/~eppstein/numth/frap.c
+forall ( otype RationalImpl | arithmetic( RationalImpl ) | { double convert( RationalImpl ); RationalImpl convert( double ); } )
+Rational(RationalImpl) narrow( double f, RationalImpl md ) {
+	if ( md <= (RationalImpl){1} ) {					// maximum fractional digits too small?
+		return (Rational(RationalImpl)){ convert( f ), (RationalImpl){1}}; // truncate fraction
+	} // if
+
+	// continued fraction coefficients
+	RationalImpl m00 = {1}, m11 = { 1 }, m01 = { 0 }, m10 = { 0 };
+	RationalImpl ai, t;
+
+	// find terms until denom gets too big
+	for ( ;; ) {
+		ai = convert( f );
+	  if ( ! (m10 * ai + m11 <= md) ) break;
+		t = m00 * ai + m01;
+		m01 = m00;
+		m00 = t;
+		t = m10 * ai + m11;
+		m11 = m10;
+		m10 = t;
+		double temp = convert( ai );
+	  if ( f == temp ) break;							// prevent division by zero
+		f = 1 / (f - temp);
+	  if ( f > (double)0x7FFFFFFF ) break;				// representation failure
+	} // for
+	return (Rational(RationalImpl)){ m00, m10 };
+} // narrow
 
 
Index: src/libcfa/stdhdr/gmp.h
===================================================================
--- src/libcfa/stdhdr/gmp.h	(revision 22634b26cbd6509a73698339709810102f49ce46)
+++ src/libcfa/stdhdr/gmp.h	(revision 22634b26cbd6509a73698339709810102f49ce46)
@@ -0,0 +1,25 @@
+//                               -*- 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.
+// 
+// gmp.h -- 
+// 
+// Author           : Peter A. Buhr
+// Created On       : Sun May 14 23:46:01 2017
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May 14 23:46:34 2017
+// Update Count     : 1
+// 
+
+extern "C" {
+#include_next <gmp.h>									// has internal check for multiple expansion
+} // extern "C"
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/tests/.expect/rational.txt
===================================================================
--- src/tests/.expect/rational.txt	(revision 9ff83109de15ee85befb018efad63d43144de47b)
+++ src/tests/.expect/rational.txt	(revision 22634b26cbd6509a73698339709810102f49ce46)
@@ -17,4 +17,11 @@
 3/1
 4/3
+conversion
+0.75
+0.142857142857143
+3.14159292035398
+3/4
+1/7
+355/113
 decompose
 more tests
Index: src/tests/rational.c
===================================================================
--- src/tests/rational.c	(revision 9ff83109de15ee85befb018efad63d43144de47b)
+++ src/tests/rational.c	(revision 22634b26cbd6509a73698339709810102f49ce46)
@@ -10,6 +10,6 @@
 // Created On       : Mon Mar 28 08:43:12 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sun May 14 18:10:28 2017
-// Update Count     : 57
+// Last Modified On : Mon May 15 21:32:22 2017
+// Update Count     : 64
 // 
 
@@ -23,4 +23,6 @@
 void ?{}( int * this, zero_t ) { *this = 0; }
 void ?{}( int * this, one_t ) { *this = 1; }
+double convert( int i ) { return (double)i; }
+int convert( double d ) { return (int)d; }
 
 int main() {
@@ -57,14 +59,14 @@
 	sout | a / b | endl;
 
-//	sout | "conversion" | endl;
-//	a = (Rational(int)){ 3, 4 };
-//	sout | widen( a ) | endl;
-//	a = (Rational(int)){ 1, 7 };
-//	sout | widen( a ) | endl;
-//	a = (Rational(int)){ 355, 113 };
-//	sout | widen( a ) | endl;
-//	sout | narrow( 0.75, 4 ) | endl;
-//	sout | narrow( 0.14285714285714, 16 ) | endl;
-//	sout | narrow( 3.14159265358979, 256 ) | endl;
+	sout | "conversion" | endl;
+	a = (Rational(int)){ 3, 4 };
+	sout | widen( a ) | endl;
+	a = (Rational(int)){ 1, 7 };
+	sout | widen( a ) | endl;
+	a = (Rational(int)){ 355, 113 };
+	sout | widen( a ) | endl;
+	sout | narrow( 0.75, 4 ) | endl;
+	sout | narrow( 0.14285714285714, 16 ) | endl;
+	sout | narrow( 3.14159265358979, 256 ) | endl;
 
 	sout | "decompose" | endl;
