Index: doc/user/user.tex
===================================================================
--- doc/user/user.tex	(revision cebfcb8e306e305227ed83ed9f13328a110bc492)
+++ doc/user/user.tex	(revision 10d78f12067a0f1c201ec831d30f0e6b49f4ef8f)
@@ -11,6 +11,6 @@
 %% Created On       : Wed Apr  6 14:53:29 2016
 %% Last Modified By : Peter A. Buhr
-%% Last Modified On : Fri Mar  6 13:34:52 2020
-%% Update Count     : 3924
+%% Last Modified On : Wed Sep 23 21:33:27 2020
+%% Update Count     : 3996
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -30,35 +30,12 @@
 \usepackage{upquote}									% switch curled `'" to straight
 \usepackage{calc}
-\usepackage{xspace}
 \usepackage{varioref}									% extended references
-\usepackage{listings}									% format program code
+\usepackage[labelformat=simple,aboveskip=0pt,farskip=0pt]{subfig}
+\renewcommand{\thesubfigure}{\alph{subfigure})}
 \usepackage[flushmargin]{footmisc}						% support label/reference in footnote
 \usepackage{latexsym}                                   % \Box glyph
 \usepackage{mathptmx}                                   % better math font with "times"
 \usepackage[usenames]{color}
-\input{common}                                          % common CFA document macros
-\usepackage[dvips,plainpages=false,pdfpagelabels,pdfpagemode=UseNone,colorlinks=true,pagebackref=true,linkcolor=blue,citecolor=blue,urlcolor=blue,pagebackref=true,breaklinks=true]{hyperref}
-\usepackage{breakurl}
-
-\usepackage[pagewise]{lineno}
-\renewcommand{\linenumberfont}{\scriptsize\sffamily}
-\usepackage[firstpage]{draftwatermark}
-\SetWatermarkLightness{0.9}
-
-% Default underscore is too low and wide. Cannot use lstlisting "literate" as replacing underscore
-% removes it as a variable-name character so keywords in variables are highlighted. MUST APPEAR
-% AFTER HYPERREF.
-\renewcommand{\textunderscore}{\leavevmode\makebox[1.2ex][c]{\rule{1ex}{0.075ex}}}
-
-\setlength{\topmargin}{-0.45in}							% move running title into header
-\setlength{\headsep}{0.25in}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-\CFAStyle												% use default CFA format-style
-\lstnewenvironment{C++}[1][]                            % use C++ style
-{\lstset{language=C++,moredelim=**[is][\protect\color{red}]{®}{®},#1}}
-{}
-
+\newcommand{\CFALatin}{}
 % inline code ©...© (copyright symbol) emacs: C-q M-)
 % red highlighting ®...® (registered trademark symbol) emacs: C-q M-.
@@ -68,4 +45,22 @@
 % keyword escape ¶...¶ (pilcrow symbol) emacs: C-q M-^
 % math escape $...$ (dollar symbol)
+\input{common}                                          % common CFA document macros
+\usepackage[dvips,plainpages=false,pdfpagelabels,pdfpagemode=UseNone,colorlinks=true,pagebackref=true,linkcolor=blue,citecolor=blue,urlcolor=blue,pagebackref=true,breaklinks=true]{hyperref}
+\usepackage{breakurl}
+
+\renewcommand\footnoterule{\kern -3pt\rule{0.3\linewidth}{0.15pt}\kern 2pt}
+
+\usepackage[pagewise]{lineno}
+\renewcommand{\linenumberfont}{\scriptsize\sffamily}
+\usepackage[firstpage]{draftwatermark}
+\SetWatermarkLightness{0.9}
+
+% Default underscore is too low and wide. Cannot use lstlisting "literate" as replacing underscore
+% removes it as a variable-name character so keywords in variables are highlighted. MUST APPEAR
+% AFTER HYPERREF.
+\renewcommand{\textunderscore}{\leavevmode\makebox[1.2ex][c]{\rule{1ex}{0.075ex}}}
+
+\setlength{\topmargin}{-0.45in}							% move running title into header
+\setlength{\headsep}{0.25in}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -80,5 +75,13 @@
 \newcommand{\KWC}{K-W C\xspace}
 
-\newsavebox{\LstBox}
+\newsavebox{\myboxA}
+\newsavebox{\myboxB}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\CFADefaults											% use default CFA format-style
+\lstnewenvironment{C++}[1][]                            % use C++ style
+{\lstset{language=C++,moredelim=**[is][\protect\color{red}]{®}{®},#1}}
+{}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -253,8 +256,8 @@
 
 The signature feature of \CFA is \emph{\Index{overload}able} \Index{parametric-polymorphic} functions~\cite{forceone:impl,Cormack90,Duggan96} with functions generalized using a ©forall© clause (giving the language its name):
-\begin{lstlisting}
+\begin{cfa}
 ®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}
+\end{cfa}
 % 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 \Index*{Glen Ditchfield}\index{Ditchfield, Glen}~\cite{Ditchfield92}, and first implemented by \Index*{Richard Bilson}\index{Bilson, Richard}~\cite{Bilson03}.
@@ -275,5 +278,5 @@
 \begin{comment}
 A simple example is leveraging the existing type-unsafe (©void *©) C ©bsearch© to binary search a sorted floating array:
-\begin{lstlisting}
+\begin{cfa}
 void * bsearch( const void * key, const void * base, size_t dim, size_t size,
 				int (* compar)( const void *, const void * ));
@@ -284,7 +287,7 @@
 double key = 5.0, vals[10] = { /* 10 sorted floating values */ };
 double * val = (double *)bsearch( &key, vals, 10, sizeof(vals[0]), comp ); §\C{// search sorted array}§
-\end{lstlisting}
+\end{cfa}
 which can be augmented simply with a polymorphic, type-safe, \CFA-overloaded wrappers:
-\begin{lstlisting}
+\begin{cfa}
 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 */ }
@@ -297,5 +300,5 @@
 double * val = bsearch( 5.0, vals, 10 ); §\C{// selection based on return type}§
 int posn = bsearch( 5.0, vals, 10 );
-\end{lstlisting}
+\end{cfa}
 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.
@@ -305,10 +308,10 @@
 \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}
+\begin{cfa}
 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}
+\end{cfa}
 where the return type supplies the type/size of the allocation, which is impossible in most type systems.
 \end{comment}
@@ -943,39 +946,4 @@
 the same level as a ©case© clause; the target label may be case ©default©, but only associated
 with the current ©switch©/©choose© statement.
-
-
-\subsection{Loop Control}
-
-The ©for©/©while©/©do-while© loop-control allows empty or simplified ranges (see Figure~\ref{f:LoopControlExamples}).
-\begin{itemize}
-\item
-The loop index is polymorphic in the type of the comparison value N (when the start value is implicit) or the start value M.
-\item
-An empty conditional implies comparison value of ©1© (true).
-\item
-A comparison N is implicit up-to exclusive range [0,N©®)®©.
-\item
-A comparison ©=© N is implicit up-to inclusive range [0,N©®]®©.
-\item
-The up-to range M ©~©\index{~@©~©} N means exclusive range [M,N©®)®©.
-\item
-The up-to range M ©~=©\index{~=@©~=©} N means inclusive range [M,N©®]®©.
-\item
-The down-to range M ©-~©\index{-~@©-~©} N means exclusive range [N,M©®)®©.
-\item
-The down-to range M ©-~=©\index{-~=@©-~=©} N means inclusive range [N,M©®]®©.
-\item
-©0© is the implicit start value;
-\item
-©1© is the implicit increment value.
-\item
-The up-to range uses operator ©+=© for increment;
-\item
-The down-to range uses operator ©-=© for decrement.
-\item
-©@© means put nothing in this field.
-\item
-©:© means start another index.
-\end{itemize}
 
 \begin{figure}
@@ -1086,4 +1054,39 @@
 
 
+\subsection{Loop Control}
+
+The ©for©/©while©/©do-while© loop-control allows empty or simplified ranges (see Figure~\ref{f:LoopControlExamples}).
+\begin{itemize}
+\item
+The loop index is polymorphic in the type of the comparison value N (when the start value is implicit) or the start value M.
+\item
+An empty conditional implies comparison value of ©1© (true).
+\item
+A comparison N is implicit up-to exclusive range [0,N©®)®©.
+\item
+A comparison ©=© N is implicit up-to inclusive range [0,N©®]®©.
+\item
+The up-to range M ©~©\index{~@©~©} N means exclusive range [M,N©®)®©.
+\item
+The up-to range M ©~=©\index{~=@©~=©} N means inclusive range [M,N©®]®©.
+\item
+The down-to range M ©-~©\index{-~@©-~©} N means exclusive range [N,M©®)®©.
+\item
+The down-to range M ©-~=©\index{-~=@©-~=©} N means inclusive range [N,M©®]®©.
+\item
+©0© is the implicit start value;
+\item
+©1© is the implicit increment value.
+\item
+The up-to range uses operator ©+=© for increment;
+\item
+The down-to range uses operator ©-=© for decrement.
+\item
+©@© means put nothing in this field.
+\item
+©:© means start another index.
+\end{itemize}
+
+
 %\subsection{\texorpdfstring{Labelled \protect\lstinline@continue@ / \protect\lstinline@break@}{Labelled continue / break}}
 \subsection{\texorpdfstring{Labelled \LstKeywordStyle{continue} / \LstKeywordStyle{break} Statement}{Labelled continue / break Statement}}
@@ -1095,81 +1098,73 @@
 for ©break©, the target label can also be associated with a ©switch©, ©if© or compound (©{}©) statement.
 \VRef[Figure]{f:MultiLevelExit} shows ©continue© and ©break© indicating the specific control structure, and the corresponding C program using only ©goto© and labels.
-The innermost loop has 7 exit points, which cause continuation or termination of one or more of the 7 \Index{nested control-structure}s.
+The innermost loop has 8 exit points, which cause continuation or termination of one or more of the 7 \Index{nested control-structure}s.
 
 \begin{figure}
-\begin{tabular}{@{\hspace{\parindentlnth}}l@{\hspace{\parindentlnth}}l@{\hspace{\parindentlnth}}l@{}}
-\multicolumn{1}{@{\hspace{\parindentlnth}}c@{\hspace{\parindentlnth}}}{\textbf{\CFA}}	& \multicolumn{1}{@{\hspace{\parindentlnth}}c}{\textbf{C}}	\\
-\begin{cfa}
-®LC:® {
-	... §declarations§ ...
-	®LS:® switch ( ... ) {
-	  case 3:
-		®LIF:® if ( ... ) {
-			®LF:® for ( ... ) {
-				®LW:® while ( ... ) {
-					... break ®LC®; ...
-					... break ®LS®; ...
-					... break ®LIF®; ...
-					... continue ®LF;® ...
-					... break ®LF®; ...
-					... continue ®LW®; ...
-					... break ®LW®; ...
-				} // while
-			} // for
-		} else {
-			... break ®LIF®; ...
-		} // if
-	} // switch
+\centering
+\begin{lrbox}{\myboxA}
+\begin{cfa}[tabsize=3]
+®Compound:® {
+	®Try:® try {
+		®For:® for ( ... ) {
+			®While:® while ( ... ) {
+				®Do:® do {
+					®If:® if ( ... ) {
+						®Switch:® switch ( ... ) {
+							case 3:
+								®break Compound®;
+								®break Try®;
+								®break For®;      /* or */  ®continue For®;
+								®break While®;  /* or */  ®continue While®;
+								®break Do®;      /* or */  ®continue Do®;
+								®break If®;
+								®break Switch®;
+							} // switch
+						} else {
+							... ®break If®; ...	// terminate if
+						} // if
+				} while ( ... ); // do
+			} // while
+		} // for
+	} ®finally® { // always executed
+	} // try
 } // compound
 \end{cfa}
-&
-\begin{cfa}
+\end{lrbox}
+
+\begin{lrbox}{\myboxB}
+\begin{cfa}[tabsize=3]
 {
-	... §declarations§ ...
-	switch ( ... ) {
-	  case 3:
-		if ( ... ) {
-			for ( ... ) {
-				while ( ... ) {
-					... goto ®LC®; ...
-					... goto ®LS®; ...
-					... goto ®LIF®; ...
-					... goto ®LFC®; ...
-					... goto ®LFB®; ...
-					... goto ®LWC®; ...
-					... goto ®LWB®; ...
-				  ®LWC®: ; } ®LWB:® ;
-			  ®LFC:® ; } ®LFB:® ;
-		} else {
-			... goto ®LIF®; ...
-		} ®L3:® ;
-	} ®LS:® ;
-} ®LC:® ;
-\end{cfa}
-&
-\begin{cfa}
-
-
-
-
-
-
-
-// terminate compound
-// terminate switch
-// terminate if
-// continue loop
-// terminate loop
-// continue loop
-// terminate loop
-
-
-
-// terminate if
-
-
-
-\end{cfa}
-\end{tabular}
+
+		®ForC:® for ( ... ) {
+			®WhileC:® while ( ... ) {
+				®DoC:® do {
+					if ( ... ) {
+						switch ( ... ) {
+							case 3:
+								®goto Compound®;
+								®goto Try®;
+								®goto ForB®;      /* or */  ®goto ForC®;
+								®goto WhileB®;  /* or */  ®goto WhileC®;
+								®goto DoB®;      /* or */  ®goto DoC®;
+								®goto If®;
+								®goto Switch®;
+							} ®Switch:® ;
+						} else {
+							... ®goto If®; ...	// terminate if
+						} ®If:®;
+				} while ( ... ); ®DoB:® ;
+			} ®WhileB:® ;
+		} ®ForB:® ;
+
+
+} ®Compound:® ;
+\end{cfa}
+\end{lrbox}
+
+\subfloat[\CFA]{\label{f:CFibonacci}\usebox\myboxA}
+\hspace{2pt}
+\vrule
+\hspace{2pt}
+\subfloat[C]{\label{f:CFAFibonacciGen}\usebox\myboxB}
 \caption{Multi-level Exit}
 \label{f:MultiLevelExit}
@@ -1426,7 +1421,7 @@
 try {
 	f(...);
-} catch( E e ; §boolean-predicate§ ) {		§\C[8cm]{// termination handler}§
+} catch( E e ; §boolean-predicate§ ) {		§\C{// termination handler}§
 	// recover and continue
-} catchResume( E e ; §boolean-predicate§ ) { §\C{// resumption handler}\CRT§
+} catchResume( E e ; §boolean-predicate§ ) { §\C{// resumption handler}§
 	// repair and return
 } finally {
@@ -3491,5 +3486,5 @@
 For implicit formatted input, the common case is reading a sequence of values separated by whitespace, where the type of an input constant must match with the type of the input variable.
 \begin{cquote}
-\begin{lrbox}{\LstBox}
+\begin{lrbox}{\myboxA}
 \begin{cfa}[aboveskip=0pt,belowskip=0pt]
 int x;   double y   char z;
@@ -3497,5 +3492,5 @@
 \end{lrbox}
 \begin{tabular}{@{}l@{\hspace{3em}}l@{\hspace{3em}}l@{}}
-\multicolumn{1}{@{}l@{}}{\usebox\LstBox} \\
+\multicolumn{1}{@{}l@{}}{\usebox\myboxA} \\
 \multicolumn{1}{c@{\hspace{2em}}}{\textbf{\CFA}}	& \multicolumn{1}{c@{\hspace{2em}}}{\textbf{\CC}}	& \multicolumn{1}{c}{\textbf{Python}}	\\
 \begin{cfa}[aboveskip=0pt,belowskip=0pt]
@@ -6672,4 +6667,7 @@
 For example, an initial alignment and fill capability are preserved during a resize copy so the copy has the same alignment and extended storage is filled.
 Without sticky properties it is dangerous to use ©realloc©, resulting in an idiom of manually performing the reallocation to maintain correctness.
+\begin{cfa}
+
+\end{cfa}
 
 \CFA memory management extends allocation to support constructors for initialization of allocated storage, \eg in
@@ -6721,24 +6719,26 @@
 
 	// §\CFA§ safe general allocation, fill, resize, alignment, array
-	T * alloc( void );§\indexc{alloc}§
-	T * alloc( size_t dim );
-	T * alloc( T ptr[], size_t dim );
-	T * alloc_set( char fill );§\indexc{alloc_set}§
-	T * alloc_set( T fill );
-	T * alloc_set( size_t dim, char fill );
-	T * alloc_set( size_t dim, T fill );
-	T * alloc_set( size_t dim, const T fill[] );
-	T * alloc_set( T ptr[], size_t dim, char fill );
-
-	T * alloc_align( size_t align );
-	T * alloc_align( size_t align, size_t dim );
-	T * alloc_align( T ptr[], size_t align ); // aligned realloc array
-	T * alloc_align( T ptr[], size_t align, size_t dim ); // aligned realloc array
-	T * alloc_align_set( size_t align, char fill );
-	T * alloc_align_set( size_t align, T fill );
-	T * alloc_align_set( size_t align, size_t dim, char fill );
-	T * alloc_align_set( size_t align, size_t dim, T fill );
-	T * alloc_align_set( size_t align, size_t dim, const T fill[] );
-	T * alloc_align_set( T ptr[], size_t align, size_t dim, char fill );
+	T * alloc( void );§\indexc{alloc}§					§\C[3.5in]{// variable, T size}§
+	T * alloc( size_t dim );							§\C{// array[dim], T size elements}§
+	T * alloc( T ptr[], size_t dim );					§\C{// realloc array[dim], T size elements}§
+
+	T * alloc_set( char fill );§\indexc{alloc_set}§		§\C{// variable, T size, fill bytes with value}§
+	T * alloc_set( T fill );							§\C{// variable, T size, fill with value}§
+	T * alloc_set( size_t dim, char fill );				§\C{// array[dim], T size elements, fill bytes with value}§
+	T * alloc_set( size_t dim, T fill );				§\C{// array[dim], T size elements, fill elements with value}§
+	T * alloc_set( size_t dim, const T fill[] );		§\C{// array[dim], T size elements, fill elements with array}§
+	T * alloc_set( T ptr[], size_t dim, char fill );	§\C{// realloc array[dim], T size elements, fill bytes with value}§
+
+	T * alloc_align( size_t align );					§\C{// aligned variable, T size}§
+	T * alloc_align( size_t align, size_t dim );		§\C{// aligned array[dim], T size elements}§
+	T * alloc_align( T ptr[], size_t align );			§\C{// realloc new aligned array}§
+	T * alloc_align( T ptr[], size_t align, size_t dim ); §\C{// realloc new aligned array[dim]}§
+
+	T * alloc_align_set( size_t align, char fill );		§\C{// aligned variable, T size, fill bytes with value}§
+	T * alloc_align_set( size_t align, T fill );		§\C{// aligned variable, T size, fill with value}§
+	T * alloc_align_set( size_t align, size_t dim, char fill ); §\C{// aligned array[dim], T size elements, fill bytes with value}§
+	T * alloc_align_set( size_t align, size_t dim, T fill ); §\C{// aligned array[dim], T size elements, fill elements with value}§
+	T * alloc_align_set( size_t align, size_t dim, const T fill[] ); §\C{// aligned array[dim], T size elements, fill elements with array}§
+	T * alloc_align_set( T ptr[], size_t align, size_t dim, char fill ); §\C{// realloc new aligned array[dim], fill new bytes with value}§
 
 	// §\CFA§ safe initialization/copy, i.e., implicit size specification
