Index: doc/user/user.tex
===================================================================
--- doc/user/user.tex	(revision 2ab67b9735bea8d47248cfb229dae71aca39af2e)
+++ doc/user/user.tex	(revision f3fc631fd4c6f01e9eff41521dac0171ea98fa7e)
@@ -11,6 +11,6 @@
 %% Created On       : Wed Apr  6 14:53:29 2016
 %% Last Modified By : Peter A. Buhr
-%% Last Modified On : Wed May 24 22:21:42 2017
-%% Update Count     : 1994
+%% Last Modified On : Tue May 30 09:08:16 2017
+%% Update Count     : 2072
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -135,8 +135,8 @@
 
 \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.
+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 \Celeven syntax.
 \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.
+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.
 
@@ -147,14 +147,14 @@
 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 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.
+\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, C, nad \CC I/O mechanisms, where the programs output the same result.
+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, C, and \CC I/O mechanisms, where the programs output the same result.
 \begin{quote2}
 \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>
+#include <fstream>§\indexc{fstream}§
 
 int main( void ) {
@@ -165,5 +165,5 @@
 &
 \begin{lstlisting}
-#include <stdio.h>
+#include <stdio.h>§\indexc{stdio.h}§
 
 int main( void ) {
@@ -174,5 +174,5 @@
 &
 \begin{lstlisting}
-#include <iostream>
+#include <iostream>§\indexc{iostream}§
 using namespace std;
 int main() {
@@ -183,5 +183,5 @@
 \end{tabular}
 \end{quote2}
-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}).
+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.
@@ -197,5 +197,5 @@
 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.
-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.
+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}
@@ -225,9 +225,9 @@
 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 \Index*{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]{\Celeven{}}~\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 \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 \Index*[C11]{\Celeven{}} 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.
 
@@ -243,5 +243,5 @@
 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.
+% 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.
@@ -262,5 +262,5 @@
 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,
+void * bsearch( const void * key, const void * base, size_t dim, size_t size,
 				int (* compar)( const void *, const void * ));
 
@@ -340,6 +340,8 @@
 The 1999 C standard plus GNU extensions.
 \item
+{\lstset{deletekeywords={inline}}
 \Indexc{-fgnu89-inline}\index{compilation option!-fgnu89-inline@{©-fgnu89-inline©}}
 Use the traditional GNU semantics for inline routines in C99 mode, which allows inline routines in header files.
+}%
 \end{description}
 The following new \CFA options are available:
@@ -412,7 +414,7 @@
 \begin{cfa}
 #ifndef __CFORALL__
-#include <stdio.h>						§\C{// C header file}§
+#include <stdio.h>§\indexc{stdio.h}§	§\C{// C header file}§
 #else
-#include <fstream>						§\C{// \CFA header file}§
+#include <fstream>§\indexc{fstream}§	§\C{// \CFA header file}§
 #endif
 \end{cfa}
@@ -747,5 +749,5 @@
 p2 = p1 + x;					§\C{// compiler infers *p2 = *p1 + x;}§
 \end{cfa}
-Algol68 infers the following deferencing ©*p2 = *p1 + x©, because adding the arbitrary integer value in ©x© to the address of ©p1© and storing the resulting address into ©p2© is an unlikely operation.
+Algol68 infers the following dereferencing ©*p2 = *p1 + x©, because adding the arbitrary integer value in ©x© to the address of ©p1© and storing the resulting address into ©p2© is an unlikely operation.
 Unfortunately, automatic dereferencing does not work in all cases, and so some mechanism is necessary to fix incorrect choices. 
 
@@ -1421,5 +1423,5 @@
 
 Given the \CFA restrictions above, both named and default arguments are backwards compatible.
-\Index*[C++]{\CC} only supports default arguments;
+\Index*[C++]{\CC{}} only supports default arguments;
 \Index*{Ada} supports both named and default arguments.
 
@@ -1455,5 +1457,5 @@
 \subsection{Type Nesting}
 
-\CFA allows \Index{type nesting}, and type qualification of the nested typres (see \VRef[Figure]{f:TypeNestingQualification}), where as C hoists\index{type hoisting} (refactors) nested types into the enclosing scope and has no type qualification.
+\CFA allows \Index{type nesting}, and type qualification of the nested types (see \VRef[Figure]{f:TypeNestingQualification}), where as C hoists\index{type hoisting} (refactors) nested types into the enclosing scope and has no type qualification.
 \begin{figure}
 \centering
@@ -1768,5 +1770,5 @@
 \index{lvalue}
 The left-hand side is a tuple of \emph{lvalues}, and the right-hand side is a tuple of \emph{expr}s.
-Each \emph{expr} appearing on the righthand side of a multiple assignment statement is assigned to the corresponding \emph{lvalues} on the left-hand side of the statement using parallel semantics for each assignment.
+Each \emph{expr} appearing on the right-hand side of a multiple assignment statement is assigned to the corresponding \emph{lvalues} on the left-hand side of the statement using parallel semantics for each assignment.
 An example of multiple assignment is:
 \begin{cfa}
@@ -1861,5 +1863,5 @@
 While C provides ©continue© and ©break© statements for altering control flow, both are restricted to one level of nesting for a particular control structure.
 Unfortunately, this restriction forces programmers to use \Indexc{goto} to achieve the equivalent control-flow for more than one level of nesting.
-To prevent having to switch to the ©goto©, \CFA extends the \Indexc{continue}\index{continue@©continue©!labelled}\index{labelled!continue@©continue©} and \Indexc{break}\index{break@©break©!labelled}\index{labelled!break@©break©} with a target label to support static multi-level exit\index{multi-level exit}\index{static multi-level exit}~\cite{Buhr85,Java}.
+To prevent having to switch to the ©goto©, \CFA extends the \Indexc{continue}\index{continue@\lstinline $continue$!labelled}\index{labelled!continue@©continue©} and \Indexc{break}\index{break@\lstinline $break$!labelled}\index{labelled!break@©break©} with a target label to support static multi-level exit\index{multi-level exit}\index{static multi-level exit}~\cite{Buhr85,Java}.
 For both ©continue© and ©break©, the target label must be directly associated with a ©for©, ©while© or ©do© statement;
 for ©break©, the target label can also be associated with a ©switch©, ©if© or compound (©{}©) statement.
@@ -1901,5 +1903,5 @@
 		if ( ... ) {
 			for ( ... ) {
-				for ( ... ) {
+				while ( ... ) {
 					... goto ®LC®; ...
 					... goto ®LS®; ...
@@ -1922,5 +1924,55 @@
 \end{figure}
 
-Both labelled ©continue© and ©break© are a ©goto©\index{goto@©goto©!restricted} restricted in the following ways:
+\begin{comment}
+int main() {
+  LC: {
+	  LS: switch ( 1 ) {
+		  case 3:
+		  LIF: if ( 1 ) {
+			  LF: for ( ;; ) {
+				  LW: while ( 1 ) {
+						break LC;			// terminate compound
+						break LS;			// terminate switch
+						break LIF;			// terminate if
+						continue LF;	 // resume loop
+						break LF;			// terminate loop
+						continue LW;	 // resume loop
+						break LW;		  // terminate loop
+					} // while
+				} // for
+			} else {
+				break LIF;					 // terminate if
+			} // if
+		} // switch
+	} // compound
+	{
+		switch ( 1 ) {
+		  case 3:
+			if ( 1 ) {
+				for ( ;; ) {
+					while ( 1 ) {
+						goto LCx;
+						goto LSx;
+						goto LIF;
+						goto LFC;
+						goto LFB;
+						goto LWC;
+						goto LWB;
+					  LWC: ; } LWB: ;
+				  LFC: ; } LFB: ;
+			} else {
+				goto LIF;
+			} L3: ;
+		} LSx: ;
+	} LCx: ;
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
+\end{comment}
+
+
+Both labelled ©continue© and ©break© are a ©goto©\index{goto@\lstinline $goto$!restricted} restricted in the following ways:
 \begin{itemize}
 \item
@@ -2249,4 +2301,6 @@
 
 The goal of \CFA I/O is to simplify the common cases\index{I/O!common case}, while fully supporting polymorphism and user defined types in a consistent way.
+The \CFA header file for the I/O library is \Indexc{fstream}.
+
 The common case is printing out a sequence of variables separated by whitespace.
 \begin{quote2}
@@ -2306,5 +2360,5 @@
 
 
-The implicit separator\index{I/O separator} character (space/blank) is a separator not a terminator.
+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}
@@ -2334,5 +2388,5 @@
 
 \item
-A separator does not appear before a C string starting with the (extended) \Index{ASCII}\index{ASCII!extended} characters: \lstinline[mathescape=off,basicstyle=\tt]@([{=$£¥¡¿«@
+A separator does not appear before a C string starting with the (extended) \Index*{ASCII}\index{ASCII!extended} characters: \lstinline[mathescape=off,basicstyle=\tt]@([{=$£¥¡¿«@
 %$
 \begin{cfa}[mathescape=off]
@@ -2349,5 +2403,5 @@
 \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: \lstinline[basicstyle=\tt]@,.;!?)]}%¢»@
+A seperator does not appear after a C string ending with the (extended) \Index*{ASCII}\index{ASCII!extended} characters: \lstinline[basicstyle=\tt]@,.;!?)]}%¢»@
 \begin{cfa}[belowskip=0pt]
 sout | 1 | ", x" | 2 | ". x" | 3 | "; x" | 4 | "! x" | 5 | "? x" | 6 | "% x"
@@ -2360,5 +2414,5 @@
 
 \item
-A seperator does not appear before or after a C string begining/ending with the \Index{ASCII} quote or whitespace characters: \lstinline[basicstyle=\tt,showspaces=true]@`'": \t\v\f\r\n@
+A seperator does not appear before or after a C string begining/ending with the \Index*{ASCII} quote or whitespace characters: \lstinline[basicstyle=\tt,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;
@@ -2630,5 +2684,5 @@
 
 \CFA supports C initialization of structures, but it also adds constructors for more advanced initialization.
-Additionally, \CFA adds destructors that are called when a variable is de-allocated (variable goes out of scope or object is deleted).
+Additionally, \CFA adds destructors that are called when a variable is deallocated (variable goes out of scope or object is deleted).
 These functions take a reference to the structure as a parameter (see References for more information).
 
@@ -2963,10 +3017,10 @@
 Generics allow programmers to use type variables in place of concrete types so that the code can be reused with multiple types.
 The type parameters can be restricted to satisfy a set of constraints.
-This enables \CFA to build fully compiled generic functions and types, unlike other languages like \Index*[C++]{\CC} where templates are expanded or must be explicitly instantiated.
+This enables \CFA to build fully compiled generic functions and types, unlike other languages like \Index*[C++]{\CC{}} where templates are expanded or must be explicitly instantiated.
 
 
 \subsection{Generic Functions}
 
-Generic functions in \CFA are similar to template functions in \Index*[C++]{\CC}, and will sometimes be expanded into specialized versions, just like in \CC.
+Generic functions in \CFA are similar to template functions in \Index*[C++]{\CC{}}, and will sometimes be expanded into specialized versions, just like in \CC.
 The difference, however, is that generic functions in \CFA can also be separately compiled, using function pointers for callers to pass in all needed functionality for the given type.
 This means that compiled libraries can contain generic functions that can be used by programs linked with them (statically or dynamically).
@@ -3087,5 +3141,5 @@
 
 Generic types are defined using the same mechanisms as those described above for generic functions.
-This feature allows users to create types that have one or more fields that use generic parameters as types, similar to a template classes in \Index*[C++]{\CC}.
+This feature allows users to create types that have one or more fields that use generic parameters as types, similar to a template classes in \Index*[C++]{\CC{}}.
 For example, to make a generic linked list, a placeholder is created for the type of the elements, so that the specific type of the elements in the list need not be specified when defining the list.
 In C, something like this would have to be done using void pointers and unsafe casting.
@@ -3139,5 +3193,5 @@
 Throwing an exception terminates execution of the current block, invokes the destructors of variables that are local to the block, and propagates the exception to the parent block.
 The exception is immediately re-thrown from the parent block unless it is caught as described below.
-\CFA uses keywords similar to \Index*[C++]{\CC} for exception handling.
+\CFA uses keywords similar to \Index*[C++]{\CC{}} for exception handling.
 An exception is thrown using a throw statement, which accepts one argument.
 
@@ -3345,5 +3399,5 @@
 
 A task may define a constructor, which will be called upon allocation and run on the caller.s thread.
-A destructor may also be defined, which is called at de-allocation (when a dynamic object is deleted or when a local object goes out of scope).
+A destructor may also be defined, which is called at deallocation (when a dynamic object is deleted or when a local object goes out of scope).
 After a task is allocated and initialized, its thread is spawned implicitly and begins executing in its function call method.
 All tasks must define this function call method, with a void return value and no additional parameters, or the compiler will report an error.
@@ -3522,5 +3576,5 @@
 \subsection{No Declarations, No Header Files}
 
-In C and \Index*[C++]{\CC}, it is necessary to declare or define every global variable, global function, and type before it is used in each file.
+In C and \Index*[C++]{\CC{}}, it is necessary to declare or define every global variable, global function, and type before it is used in each file.
 Header files and a preprocessor are normally used to avoid repeating code.
 Thus, many variables, functions, and types are described twice, which exposes an opportunity for errors and causes additional maintenance work.
@@ -4167,5 +4221,5 @@
 In developing \CFA, many other languages were consulted for ideas, constructs, and syntax.
 Therefore, it is important to show how these languages each compare with Do.
-In this section, \CFA is compared with what the writers of this document consider to be the closest competitors of Do: \Index*[C++]{\CC}, \Index*{Go}, \Index*{Rust}, and \Index*{D}.
+In this section, \CFA is compared with what the writers of this document consider to be the closest competitors of Do: \Index*[C++]{\CC{}}, \Index*{Go}, \Index*{Rust}, and \Index*{D}.
 
 
@@ -4792,5 +4846,5 @@
 \subsubsection[C++]{\CC}
 
-\Index*[C++]{\CC} is a general-purpose programming language.
+\Index*[C++]{\CC{}} is a general-purpose programming language.
 It has imperative, object-oriented and generic programming features, while also providing facilities for low-level memory manipulation. (Wikipedia)
 
@@ -4977,5 +5031,5 @@
 }
 \end{cfa}
-\item[Rationale:] dropped from C11 standard.\footnote{
+\item[Rationale:] dropped from \Celeven standard.\footnote{
 At least one type specifier shall be given in the declaration specifiers in each declaration, and in the specifier-qualifier list in each structure declaration and type name~\cite[\S~6.7.2(2)]{C11}}
 \item[Effect on original feature:] original feature is deprecated. \\
@@ -5045,5 +5099,5 @@
 static struct X a = { 1, &b };	§\C{// definition}§
 \end{cfa}
-\item[Rationale:] avoids having different initialization rules for builtin types and userdefined types.
+\item[Rationale:] avoids having different initialization rules for builtin types and user-defined types.
 \item[Effect on original feature:] change to semantics of well-defined feature.
 \item[Difficulty of converting:] the initializer for one of a set of mutually-referential file-local static objects must invoke a routine call to achieve the initialization.
@@ -5070,5 +5124,5 @@
 \end{cfa}
 In C, the name of the nested types belongs to the same scope as the name of the outermost enclosing structure, \ie the nested types are hoisted to the scope of the outer-most type, which is not useful and confusing.
-\CFA is C \emph{incompatible} on this issue, and provides semantics similar to \Index*[C++]{\CC}.
+\CFA is C \emph{incompatible} on this issue, and provides semantics similar to \Index*[C++]{\CC{}}.
 Nested types are not hoisted and can be referenced using the field selection operator ``©.©'', unlike the \CC scope-resolution operator ``©::©''.
 \item[Rationale:] ©struct© scope is crucial to \CFA as an information structuring and hiding mechanism.
@@ -5086,5 +5140,5 @@
 struct Y;						§\C{// struct Y and struct X are at the same scope}§
 struct X {
-struct Y { /* ... */ } y;
+	struct Y { /* ... */ } y;
 };
 \end{cfa}
@@ -5108,62 +5162,63 @@
 \label{s:StandardHeaders}
 
-C11 prescribes the following standard header-files~\cite[\S~7.1.2]{C11} and \CFA adds to this list:
+\Celeven prescribes the following standard header-files~\cite[\S~7.1.2]{C11} and \CFA adds to this list:
 \begin{quote2}
-\begin{tabular}{llll|l}
+\lstset{deletekeywords={float},deletekeywords=[2]{signal}}
+\begin{tabular}{@{}llll|l@{}}
 \multicolumn{4}{c|}{C11} & \multicolumn{1}{c}{\CFA}		\\
 \hline
 \begin{tabular}{@{}l@{}}
-assert.h	\\
-complex.h	\\
-ctype.h		\\
-errno.h		\\
-fenv.h		\\
-float.h		\\
-inttypes.h	\\
-iso646.h	\\
+\Indexc{assert.h}		\\
+\Indexc{complex.h}		\\
+\Indexc{ctype.h}		\\
+\Indexc{errno.h}		\\
+\Indexc{fenv.h}			\\
+\Indexc{float.h}		\\
+\Indexc{inttypes.h}		\\
+\Indexc{iso646.h}		\\
 \end{tabular}
 &
 \begin{tabular}{@{}l@{}}
-limits.h	\\
-locale.h	\\
-math.h		\\
-setjmp.h	\\
-signal.h	\\
-stdalign.h	\\
-stdarg.h	\\
-stdatomic.h	\\
+\Indexc{limits.h}		\\
+\Indexc{locale.h}		\\
+\Indexc{math.h}			\\
+\Indexc{setjmp.h}		\\
+\Indexc{signal.h}		\\
+\Indexc{stdalign.h}		\\
+\Indexc{stdarg.h}		\\
+\Indexc{stdatomic.h}	\\
 \end{tabular}
 &
 \begin{tabular}{@{}l@{}}
-stdbool.h	\\
-stddef.h	\\
-stdint.h	\\
-stdio.h		\\
-stdlib.h	\\
-stdnoreturn.h \\
-string.h	\\
-tgmath.h	\\
+\Indexc{stdbool.h}		\\
+\Indexc{stddef.h}		\\
+\Indexc{stdint.h}		\\
+\Indexc{stdio.h}		\\
+\Indexc{stdlib.h}		\\
+\Indexc{stdnoreturn.h}	\\
+\Indexc{string.h}		\\
+\Indexc{tgmath.h}		\\
 \end{tabular}
 &
 \begin{tabular}{@{}l@{}}
-threads.h	\\
-time.h		\\
-uchar.h		\\
-wchar.h		\\
-wctype.h	\\
-			\\
-			\\
-			\\
+\Indexc{threads.h}		\\
+\Indexc{time.h}			\\
+\Indexc{uchar.h}		\\
+\Indexc{wchar.h}		\\
+\Indexc{wctype.h}		\\
+						\\
+						\\
+						\\
 \end{tabular}
 &
 \begin{tabular}{@{}l@{}}
-unistd.h	\\
-gmp.h		\\
-			\\
-			\\
-			\\
-			\\
-			\\
-			\\
+\Indexc{unistd.h}		\\
+\Indexc{gmp.h}			\\
+						\\
+						\\
+						\\
+						\\
+						\\
+						\\
 \end{tabular}
 \end{tabular}
@@ -5177,30 +5232,74 @@
 \label{s:StandardLibrary}
 
-The \CFA standard-library wraps explicitly-polymorphic C general-routines into implicitly-polymorphic versions.
-
-
-\subsection{malloc}
+The \CFA standard-library wraps explicitly-polymorphic C routines into implicitly-polymorphic versions.
+
+
+\subsection{Storage Management}
+
+The storage-management routines extend their C equivalents by overloading, alternate names, providing shallow type-safety, and removing the need to specify the allocation size for non-array types.
+\begin{center}
+\begin{tabular}{@{}r|l|l|l|l@{}}
+					& fill				& resize	& alignment	& array	\\
+\hline
+©malloc©			& no/yes			& no/yes	& no		& no	\\
+©amalloc©			& no/copy data/yes	& no/yes	& no		& yes	\\
+©calloc©			& yes (0 only)		& no		& no		& yes	\\
+©realloc©			& no/copy data		& yes		& no		& no	\\
+©memalign©			& no/yes			& no		& yes		& no	\\
+©amemalign©			& no/yes			& no		& yes		& yes	\\
+©align_alloc©		& no				& no		& yes		& no	\\
+©posix_memalign©	& no				& no		& yes		& no	\\
+\end{tabular}
+\end{center}
+When ©amalloc© resizes and fills, the space after the copied data from the source is set to the fill character.
+It is impossible to resize with alignment because the underlying ©realloc© allocates storage if more space is needed, and it does not honour alignment from the original allocation.
 
 \leavevmode
 \begin{cfa}[aboveskip=0pt,belowskip=0pt]
+// allocation, non-array types
 forall( dtype T | sized(T) ) T * malloc( void );§\indexc{malloc}§
 forall( dtype T | sized(T) ) T * malloc( char fill );
-forall( dtype T | sized(T) ) T * malloc( T * ptr, size_t size );
-forall( dtype T | sized(T) ) T * malloc( T * ptr, size_t size, unsigned char fill );
-forall( dtype T | sized(T) ) T * calloc( size_t nmemb );§\indexc{calloc}§
-forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size );§\indexc{ato}§
-forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size, unsigned char fill );
-
-forall( dtype T | sized(T) ) T * aligned_alloc( size_t alignment );§\indexc{ato}§
-forall( dtype T | sized(T) ) T * memalign( size_t alignment );		// deprecated
-forall( dtype T | sized(T) ) int posix_memalign( T ** ptr, size_t alignment );
-
-forall( dtype T, ttype Params | sized(T) | { void ?{}(T *, Params); } ) T * new( Params p );
-forall( dtype T | { void ^?{}(T *); } ) void delete( T * ptr );
-forall( dtype T, ttype Params | { void ^?{}(T *); void delete(Params); } ) void delete( T * ptr, Params rest );
-\end{cfa}
-
-
-\subsection{ato / strto}
+
+// allocation, array types
+forall( dtype T | sized(T) ) T * calloc( size_t dim );§\indexc{cmalloc}§
+forall( dtype T | sized(T) ) T * amalloc( size_t dim );§\indexc{amalloc}§  // alternate name for calloc
+forall( dtype T | sized(T) ) T * amalloc( size_t dim, char fill );
+
+// resize, non-array types
+forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size );§\indexc{realloc}§
+forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size, char fill );
+forall( dtype T | sized(T) ) T * malloc( T * ptr, size_t size );  // alternate name for realloc
+forall( dtype T | sized(T) ) T * malloc( T * ptr, size_t size, char fill );
+
+// resize, array types
+forall( dtype T | sized(T) ) T * amalloc( T * ptr, size_t dim );
+forall( dtype T | sized(T) ) T * amalloc( T * ptr, size_t dim, char fill );
+
+// alignment, non-array types
+forall( dtype T | sized(T) ) T * memalign( size_t alignment );§\indexc{memalign}§
+forall( dtype T | sized(T) ) T * memalign( size_t alignment, char fill );
+forall( dtype T | sized(T) ) T * aligned_alloc( size_t alignment );§\indexc{aligned_alloc}§
+forall( dtype T | sized(T) ) int posix_memalign( T ** ptr, size_t alignment );§\indexc{posix_memalign}§
+
+// alignment, array types
+forall( dtype T | sized(T) ) T * amemalign( size_t alignment, size_t dim );§\indexc{amemalign}§
+forall( dtype T | sized(T) ) T * amemalign( size_t alignment, size_t dim, char fill );
+
+// data, non-array types
+forall( dtype T | sized(T) ) T * memset( T * dest, char c );§\indexc{memset}§
+forall( dtype T | sized(T) ) T * memcpy( T * dest, const T * src );§\indexc{memcpy}§
+
+// data, array types
+forall( dtype T | sized(T) ) T * amemset( T * dest, size_t dim, char c );§\indexc{amemset}§
+forall( dtype T | sized(T) ) T * amemcpy( T * dest, const T * src, size_t dim );§\indexc{amemcpy}§
+
+// allocation/deallocation and constructor/destructor
+forall( dtype T, ttype Params | sized(T) | { void ?{}(T *, Params); } ) T * new( Params p );§\indexc{new}§
+forall( dtype T | { void ^?{}( T * ); } ) void delete( T * ptr );§\indexc{delete}§
+forall( dtype T, ttype Params | { void ^?{}( T * ); void delete(Params); } ) void delete( T * ptr, Params rest );
+\end{cfa}
+
+
+\subsection{Conversion}
 
 \leavevmode
@@ -5234,12 +5333,12 @@
 
 
-\subsection{bsearch / qsort}
+\subsection{Search / Sort}
 
 \leavevmode
 \begin{cfa}[aboveskip=0pt,belowskip=0pt]
-forall( otype T | { int ?<?( T, T ); } )	// location
+forall( otype T | { int ?<?( T, T ); } )	§\C{// location}§
 T * bsearch( T key, const T * arr, size_t dimension );§\indexc{bsearch}§
 
-forall( otype T | { int ?<?( T, T ); } )	// position
+forall( otype T | { int ?<?( T, T ); } )	§\C{// position}§
 unsigned int bsearch( T key, const T * arr, size_t dimension );
 
@@ -5249,5 +5348,5 @@
 
 
-\subsection{abs}
+\subsection{Absolute Value}
 
 \leavevmode
@@ -5268,5 +5367,5 @@
 
 
-\subsection{random}
+\subsection{Random Numbers}
 
 \leavevmode
@@ -5286,5 +5385,5 @@
 
 
-\subsection{min / max / clamp / swap}
+\subsection{Algorithms}
 
 \leavevmode
@@ -5671,7 +5770,7 @@
 \label{s:MultiPrecisionIntegers}
 
-\CFA has an interface to the \Index{GMP} \Index{multi-precision} signed-integers~\cite{GMP}, similar to the \CC interface provided by GMP.
+\CFA has an interface to the GMP \Index{multi-precision} signed-integers~\cite{GMP}, similar to the \CC interface provided by GMP.
 The \CFA interface wraps GMP routines into operator routines to make programming with multi-precision integers identical to using fixed-sized integers.
-The \CFA type name for multi-precision signed-integers is \Indexc{Int}.
+The \CFA type name for multi-precision signed-integers is \Indexc{Int} and the header file is \Indexc{gmp}.
 
 \begin{cfa}
@@ -5843,9 +5942,9 @@
 \hline
 \begin{cfa}
-#include <gmp>
+#include <gmp>§\indexc{gmp}§
 int main( void ) {
 	sout | "Factorial Numbers" | endl;
-	Int fact;
-	fact = 1;
+	Int fact = 1;
+
 	sout | 0 | fact | endl;
 	for ( unsigned int i = 1; i <= 40; i += 1 ) {
@@ -5857,5 +5956,5 @@
 &
 \begin{cfa}
-#include <gmp.h>
+#include <gmp.h>§\indexc{gmp.h}§
 int main( void ) {
 	®gmp_printf®( "Factorial Numbers\n" );
Index: src/libcfa/stdlib
===================================================================
--- src/libcfa/stdlib	(revision 2ab67b9735bea8d47248cfb229dae71aca39af2e)
+++ src/libcfa/stdlib	(revision f3fc631fd4c6f01e9eff41521dac0171ea98fa7e)
@@ -10,6 +10,6 @@
 // Created On       : Thu Jan 28 17:12:35 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed May 24 18:06:27 2017
-// Update Count     : 115
+// Last Modified On : Tue May 30 09:07:35 2017
+// Update Count     : 164
 //
 
@@ -28,21 +28,116 @@
 //---------------------------------------
 
-forall( dtype T | sized(T) ) T * malloc( void );
-forall( dtype T | sized(T) ) T * malloc( char fill );
-forall( dtype T | sized(T) ) T * malloc( T * ptr, size_t size );
-forall( dtype T | sized(T) ) T * malloc( T * ptr, size_t size, unsigned char fill );
-extern "C" { void * calloc( size_t nmemb, size_t size ); } // use default C routine for void *
-forall( dtype T | sized(T) ) T * calloc( size_t nmemb );
+extern "C" { void * memset( void * dest, int c, size_t size ); } // use default C routine for void *
+
+// allocation, non-array types
+static inline forall( dtype T | sized(T) ) T * malloc( void ) {
+	//printf( "X1\n" );
+	return (T *)(void *)malloc( (size_t)sizeof(T) );	// C malloc
+} // malloc
+static inline forall( dtype T | sized(T) ) T * malloc( char fill ) {
+	//printf( "X2\n" );
+	T * ptr = (T *)(void *)malloc( (size_t)sizeof(T) );	// C malloc
+    return memset( ptr, (int)fill, sizeof(T) );			// initial with fill value
+} // malloc
+
+// allocation, array types
+extern "C" { void * calloc( size_t dim, size_t size ); } // use default C routine for void *
+static inline forall( dtype T | sized(T) ) T * calloc( size_t dim ) {
+	//printf( "X3\n" );
+	return (T *)(void *)calloc( dim, sizeof(T) );		// C cmalloc
+}
+static inline forall( dtype T | sized(T) ) T * amalloc( size_t dim ) { // alternative name
+	//printf( "X4\n" );
+	return (T *)(void *)malloc( dim * (size_t)sizeof(T) ); // C malloc
+} // amalloc
+static inline forall( dtype T | sized(T) ) T * amalloc( size_t dim, char fill ) { // alternative name
+	//printf( "X5\n" );
+	T * ptr = (T *)(void *)malloc( dim * (size_t)sizeof(T) ); // C malloc
+    return memset( ptr, (int)fill, dim * sizeof(T) );
+} // amalloc
+
+// resize, non-array types
 extern "C" { void * realloc( void * ptr, size_t size ); } // use default C routine for void *
-forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size );
-forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size, unsigned char fill );
-
-forall( dtype T | sized(T) ) T * aligned_alloc( size_t alignment );
-forall( dtype T | sized(T) ) T * memalign( size_t alignment );		// deprecated
-forall( dtype T | sized(T) ) int posix_memalign( T ** ptr, size_t alignment );
-
+static inline forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size ) {
+	//printf( "X5.5\n" );
+	return (T *)(void *)realloc( (void *)ptr, size );
+}
+forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size, char fill );
+static inline forall( dtype T | sized(T) ) T * malloc( T * ptr, size_t size ) {	// alternative name
+	//printf( "X7\n" );
+	return realloc( ptr, size );
+} // malloc
+static inline forall( dtype T | sized(T) ) T * malloc( T * ptr, size_t size, char fill ) { // alternative name
+	//printf( "X8\n" );
+	return realloc( ptr, size, fill );
+} // malloc
+
+// resize, array types
+static inline forall( dtype T | sized(T) ) T * amalloc( T * ptr, size_t dim ) {
+	//printf( "X9\n" );
+	return malloc( ptr, dim * (size_t)sizeof(T) );
+} // amalloc
+static inline forall( dtype T | sized(T) ) T * amalloc( T * ptr, size_t dim, char fill ) {
+	//printf( "X10\n" );
+	return malloc( ptr, dim * (size_t)sizeof(T), fill );
+} // amalloc
+
+// alignment, non-array types
+extern "C" { void * memalign( size_t alignment, size_t size ); } // use default C routine for void *
+static inline forall( dtype T | sized(T) ) T * memalign( size_t alignment ) {
+	//printf( "X11\n" );
+	return (T *)memalign( alignment, sizeof(T) );
+} // memalign
+static inline forall( dtype T | sized(T) ) T * memalign( size_t alignment, char fill ) {
+	//printf( "X12\n" );
+    T * ptr = (T *)memalign( alignment, sizeof(T) );
+    return memset( ptr, (int)fill, sizeof(T) );
+} // memalign
+static inline forall( dtype T | sized(T) ) T * aligned_alloc( size_t alignment ) {
+	//printf( "X13\n" );
+	return (T *)memalign( alignment, sizeof(T) );
+} // aligned_alloc
+extern "C" { int posix_memalign( void ** ptr, size_t alignment, size_t size ); } // use default C routine for void *
+static inline forall( dtype T | sized(T) ) int posix_memalign( T ** ptr, size_t alignment ) {
+	//printf( "X14\n" );
+	return posix_memalign( (void **)ptr, alignment, sizeof(T) );
+} // posix_memalign
+
+// alignment, array types
+static inline forall( dtype T | sized(T) ) T * amemalign( size_t alignment, size_t dim ) {
+	//printf( "X15\n" );
+	return (T *)memalign( alignment, dim * sizeof(T) );
+} // amemalign
+static inline forall( dtype T | sized(T) ) T * amemalign( size_t alignment, size_t dim, char fill ) {
+	//printf( "X16\n" );
+    T * ptr = (T *)memalign( alignment, dim * sizeof(T) );
+    return memset( ptr, (int)fill, dim * sizeof(T) );
+} // amemalign
+
+// data, non-array types
+static inline forall( dtype T | sized(T) ) T * memset( T * dest, char c ) {
+	//printf( "X17\n" );
+	return memset( dest, c, sizeof(T) );
+} // memset
+extern "C" { void * memcpy( void * dest, const void * src, size_t size ); } // use default C routine for void *
+static inline forall( dtype T | sized(T) ) T * memcpy( T * dest, const T * src ) {
+	//printf( "X18\n" );
+	return memcpy( dest, src, sizeof(T) );
+} // memcpy
+
+// data, array types
+static inline forall( dtype T | sized(T) ) T * amemset( T * dest, size_t dim, char c ) {
+	//printf( "X19\n" );
+	return memset( dest, c, dim * sizeof(T) );
+} // amemset
+static inline forall( dtype T | sized(T) ) T * amemcpy( T * dest, const T * src, size_t dim ) {
+	//printf( "X20\n" );
+	return memcpy( dest, src, dim * sizeof(T) );
+} // amemcpy
+
+// allocation/deallocation and constructor/destructor
 forall( dtype T, ttype Params | sized(T) | { void ?{}(T *, Params); } ) T * new( Params p );
-forall( dtype T | { void ^?{}(T *); } ) void delete( T * ptr );
-forall( dtype T, ttype Params | { void ^?{}(T *); void delete(Params); } ) void delete( T * ptr, Params rest );
+forall( dtype T | { void ^?{}( T * ); } ) void delete( T * ptr );
+forall( dtype T, ttype Params | { void ^?{}( T * ); void delete( Params ); } ) void delete( T * ptr, Params rest );
 
 //---------------------------------------
@@ -77,12 +172,12 @@
 
 forall( otype T | { int ?<?( T, T ); } )
-T * bsearch( T key, const T * arr, size_t dimension );
-
-forall( otype T | { int ?<?( T, T ); } )
-unsigned int bsearch( T key, const T * arr, size_t dimension );
-
-
-forall( otype T | { int ?<?( T, T ); } )
-void qsort( const T * arr, size_t dimension );
+T * bsearch( T key, const T * arr, size_t dim );
+
+forall( otype T | { int ?<?( T, T ); } )
+unsigned int bsearch( T key, const T * arr, size_t dim );
+
+
+forall( otype T | { int ?<?( T, T ); } )
+void qsort( const T * arr, size_t dim );
 
 //---------------------------------------
Index: src/libcfa/stdlib.c
===================================================================
--- src/libcfa/stdlib.c	(revision 2ab67b9735bea8d47248cfb229dae71aca39af2e)
+++ src/libcfa/stdlib.c	(revision f3fc631fd4c6f01e9eff41521dac0171ea98fa7e)
@@ -10,6 +10,6 @@
 // Created On       : Thu Jan 28 17:10:29 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed May 24 18:13:15 2017
-// Update Count     : 198
+// Last Modified On : Tue May 30 09:07:56 2017
+// Update Count     : 237
 //
 
@@ -21,5 +21,5 @@
 #define _XOPEN_SOURCE 600								// posix_memalign, *rand48
 #include <stdlib.h>										// malloc, free, calloc, realloc, memalign, posix_memalign, bsearch
-#include <string.h>										// memset
+#include <string.h>										// memcpy, memset
 #include <malloc.h>										// malloc_usable_size
 #include <math.h>										// fabsf, fabs, fabsl
@@ -27,71 +27,36 @@
 } // extern "C"
 
-forall( dtype T | sized(T) ) T * malloc( void ) {		// type-safe
-    return (T *)(void *)malloc( (size_t)sizeof(T) );
-} // malloc
-
-forall( dtype T | sized(T) ) T * malloc( char fill ) {	// initial with fill value (like calloc)
-	T * ptr = (T *)(void *)malloc( (size_t)sizeof(T) );
-    return memset( ptr, (int)fill, sizeof(T) );
-} // malloc
-
-forall( dtype T | sized(T) ) T * malloc( T * ptr, size_t size ) { // alternative realloc
-    return (T *)realloc( ptr, size );
-} // malloc
-
-forall( dtype T | sized(T) ) T * malloc( T * ptr, size_t size, unsigned char fill ) { // alternative realloc with fill value
-    return (T *)realloc( ptr, size, fill );
-} // malloc
-
-
-forall( dtype T | sized(T) ) T * calloc( size_t nmemb ) { // type-safe array initialization with fill 0
-    return (T *)calloc( nmemb, sizeof(T) );
-} // calloc
-
-
-forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size ) { // type-safe
-    return (T *)(void *)realloc( (void *)ptr, size );
+// resize, non-array types
+forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size, char fill ) { // alternative realloc with fill value
+	//printf( "X6\n" );
+	size_t olen = malloc_usable_size( ptr );			// current allocation
+    char * nptr = (void *)realloc( (void *)ptr, size );	// C realloc
+	size_t nlen = malloc_usable_size( nptr );			// new allocation
+	if ( nlen > olen ) {								// larger ?
+		memset( nptr + olen, (int)fill, nlen - olen );	// initialize added storage
+	} // 
+    return (T *)nptr;
 } // realloc
 
-forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size, unsigned char fill ) { // alternative realloc with fill value
-    char * nptr = (T *)(void *)realloc( (void *)ptr, size );
-    size_t unused = malloc_usable_size( nptr );
-    memset( nptr + size - unused, (int)fill, unused );	// initialize any new storage
-    return nptr;
-} // realloc
-
-
-forall( dtype T | sized(T) ) T * aligned_alloc( size_t alignment ) { // aligned allocation
-    return (T *)memalign( alignment, sizeof(T) );
-} // aligned_alloc
-
-forall( dtype T | sized(T) ) T * memalign( size_t alignment ) {
-    return (T *)memalign( alignment, sizeof(T) );
-} // memalign
-
-forall( dtype T | sized(T) ) int posix_memalign( T ** ptr, size_t alignment ) {
-    return posix_memalign( (void **)ptr, alignment, sizeof(T) );
-} // posix_memalign
-
-
-forall( dtype T, ttype Params | sized(T) | { void ?{}( T *, Params ); } ) //  new
+// allocation/deallocation and constructor/destructor
+forall( dtype T, ttype Params | sized(T) | { void ?{}( T *, Params ); } )
 T * new( Params p ) {
 	return ((T *)malloc()){ p };
 } // new
 
-forall( dtype T | { void ^?{}(T *); } )					// delete
+forall( dtype T | { void ^?{}( T * ); } )
 void delete( T * ptr ) {
 	if ( ptr ) {
-		^ptr{};
+		^ptr{};											// run destructor
 		free( ptr );
-	}
+	} // if
 } // delete
 
-forall( dtype T, ttype Params | { void ^?{}(T *); void delete(Params); } )
+forall( dtype T, ttype Params | { void ^?{}( T * ); void delete( Params ); } )
 void delete( T * ptr, Params rest ) {
 	if ( ptr ) {
-		^ptr{};
+		^ptr{};											// run destructor
 		free( ptr );
-	}
+	} // if
 	delete( rest );
 } // delete
@@ -242,19 +207,19 @@
 
 forall( otype T | { int ?<?( T, T ); } )
-T * bsearch( T key, const T * arr, size_t dimension ) {
+T * bsearch( T key, const T * arr, size_t dim ) {
 	int comp( const void * t1, const void * t2 ) { return *(T *)t1 < *(T *)t2 ? -1 : *(T *)t2 < *(T *)t1 ? 1 : 0; }
-	return (T *)bsearch( &key, arr, dimension, sizeof(T), comp );
+	return (T *)bsearch( &key, arr, dim, sizeof(T), comp );
 } // bsearch
 
 forall( otype T | { int ?<?( T, T ); } )
-unsigned int bsearch( T key, const T * arr, size_t dimension ) {
-	T *result = bsearch( key, arr, dimension );
-	return result ? result - arr : dimension;			// pointer subtraction includes sizeof(T)
+unsigned int bsearch( T key, const T * arr, size_t dim ) {
+	T *result = bsearch( key, arr, dim );
+	return result ? result - arr : dim;					// pointer subtraction includes sizeof(T)
 } // bsearch
 
 forall( otype T | { int ?<?( T, T ); } )
-void qsort( const T * arr, size_t dimension ) {
+void qsort( const T * arr, size_t dim ) {
 	int comp( const void * t1, const void * t2 ) { return *(T *)t1 < *(T *)t2 ? -1 : *(T *)t2 < *(T *)t1 ? 1 : 0; }
-	qsort( arr, dimension, sizeof(T), comp );
+	qsort( arr, dim, sizeof(T), comp );
 } // qsort
 
