Index: doc/theses/andrew_beach_MMath/existing.tex
===================================================================
--- doc/theses/andrew_beach_MMath/existing.tex	(revision 417e8eaa44760977da4cbd577e921dc2017e11ab)
+++ doc/theses/andrew_beach_MMath/existing.tex	(revision fa7dbf1935a3c62d39510a874ce75acf6c74a52c)
@@ -10,5 +10,6 @@
 
 Only those \CFA features pertaining to this thesis are discussed.
-Also, only new features of \CFA will be discussed, a familiarity with
+% Also, only new features of \CFA will be discussed,
+A familiarity with
 C or C-like languages is assumed.
 
@@ -16,9 +17,9 @@
 \CFA has extensive overloading, allowing multiple definitions of the same name
 to be defined~\cite{Moss18}.
-\begin{cfa}
-char i; int i; double i;
-int f(); double f();
-void g( int ); void g( double );
-\end{cfa}
+\begin{lstlisting}[language=CFA,{moredelim=**[is][\color{red}]{@}{@}}]
+char @i@; int @i@; double @i@;
+int @f@(); double @f@();
+void @g@( int ); void @g@( double );
+\end{lstlisting}
 This feature requires name mangling so the assembly symbols are unique for
 different overloads. For compatibility with names in C, there is also a syntax
@@ -62,5 +63,5 @@
 int && rri = ri;
 rri = 3;
-&ri = &j;
+&ri = &j; // rebindable
 ri = 5;
 \end{cfa}
@@ -78,6 +79,6 @@
 \end{minipage}
 
-References are intended to be used when you would use pointers but would
-be dereferencing them (almost) every usage.
+References are intended for pointer situations where dereferencing is the common usage,
+\ie the value is more important than the pointer.
 Mutable references may be assigned to by converting them to a pointer
 with a @&@ and then assigning a pointer to them, as in @&ri = &j;@ above
@@ -85,70 +86,75 @@
 \section{Operators}
 
-\CFA implements operator overloading by providing special names.
-Operator uses are translated into function calls using these names.
-These names are created by taking the operator symbols and joining them with
-@?@s to show where the arguments go.
+\CFA implements operator overloading by providing special names, where
+operator usages are translated into function calls using these names.
+An operator name is created by taking the operator symbols and joining them with
+@?@s to show where the parameters go.
 For example,
-infixed multiplication is @?*?@ while prefix dereference is @*?@.
+infixed multiplication is @?*?@, while prefix dereference is @*?@.
 This syntax make it easy to tell the difference between prefix operations
 (such as @++?@) and post-fix operations (@?++@).
-
+For example, plus and equality operators are defined for a point type.
 \begin{cfa}
 point ?+?(point a, point b) { return point{a.x + b.x, a.y + b.y}; }
-bool ?==?(point a, point b) { return a.x == b.x && a.y == b.y; }
+int ?==?(point a, point b) { return a.x == b.x && a.y == b.y; }
 {
 	assert(point{1, 2} + point{3, 4} == point{4, 6});
 }
 \end{cfa}
-Note that these special names are not limited to just being used for these
-operator functions, and may be used name other declarations.
-Some ``near misses", that will not match an operator form but looks like
-it may have been supposed to, will generate wantings but otherwise they are
-left alone.
+Note these special names are not limited to builtin
+operators, and hence, may be used with arbitrary types.
+\begin{cfa}
+double ?+?( int x, point y ); // arbitrary types
+\end{cfa}
+% Some ``near misses", that are that do not match an operator form but looks like
+% it may have been supposed to, will generate warning but otherwise they are
+% left alone.
+Because operators are never part of the type definition they may be added
+at any time, including on built-in types.
 
 %\subsection{Constructors and Destructors}
 
-Both constructors and destructors are operators, which means they are
-functions with special operator names rather than type names in \Cpp. The
-special operator names may be used to call the functions explicitly.
-% Placement new means that this is actually equivant to C++.
+\CFA also provides constructors and destructors as operators, which means they
+are functions with special operator names rather than type names in \Cpp.
+While constructors and destructions are normally called implicitly by the compiler,
+the special operator names, allow explicit calls.
+
+% Placement new means that this is actually equivalent to C++.
 
 The special name for a constructor is @?{}@, which comes from the
 initialization syntax in C, \eg @Example e = { ... }@.
-\CFA will generate a constructor call each time a variable is declared,
-passing the initialization arguments to the constructort.
+\CFA generates a constructor call each time a variable is declared,
+passing the initialization arguments to the constructor.
 \begin{cfa}
 struct Example { ... };
 void ?{}(Example & this) { ... }
-{
-	Example a;
-	Example b = {};
-}
 void ?{}(Example & this, char first, int num) { ... }
-{
-	Example c = {'a', 2};
-}
-\end{cfa}
-Both @a@ and @b@ will be initalized with the first constructor,
-while @c@ will be initalized with the second.
-Currently, there is no general way to skip initialation.
-
+Example a;		// implicit constructor calls
+Example b = {};
+Example c = {'a', 2};
+\end{cfa}
+Both @a@ and @b@ are initialized with the first constructor,
+while @c@ is initialized with the second.
+Constructor calls can be replaced with C initialization using special operator \lstinline{@=}.
+\begin{cfa}
+Example d @= {42};
+\end{cfa}
 % I don't like the \^{} symbol but $^\wedge$ isn't better.
-Similarly destructors use the special name @^?{}@ (the @^@ has no special
+Similarly, destructors use the special name @^?{}@ (the @^@ has no special
 meaning).
-These are a normally called implicitly called on a variable when it goes out
-of scope. They can be called explicitly as well.
+% These are a normally called implicitly called on a variable when it goes out
+% of scope. They can be called explicitly as well.
 \begin{cfa}
 void ^?{}(Example & this) { ... }
 {
-	Example d;
-} // <- implicit destructor call
-\end{cfa}
-
-Whenever a type is defined, \CFA will create a default zero-argument
+	Example e;	// implicit constructor call
+	^?{}(e);		// explicit destructor call
+	?{}(e);		// explicit constructor call
+} // implicit destructor call
+\end{cfa}
+
+Whenever a type is defined, \CFA creates a default zero-argument
 constructor, a copy constructor, a series of argument-per-field constructors
 and a destructor. All user constructors are defined after this.
-Because operators are never part of the type definition they may be added
-at any time, including on built-in types.
 
 \section{Polymorphism}
@@ -202,5 +208,5 @@
 Note, a function named @do_once@ is not required in the scope of @do_twice@ to
 compile it, unlike \Cpp template expansion. Furthermore, call-site inferencing
-allows local replacement of the most specific parametric functions needs for a
+allows local replacement of the specific parametric functions needs for a
 call.
 \begin{cfa}
@@ -218,10 +224,10 @@
 to @do_twice@ and called within it.
 The global definition of @do_once@ is ignored, however if quadruple took a
-@double@ argument then the global definition would be used instead as it
-would be a better match.
+@double@ argument, then the global definition would be used instead as it
+is a better match.
 % Aaron's thesis might be a good reference here.
 
 To avoid typing long lists of assertions, constraints can be collect into
-convenient packages called a @trait@, which can then be used in an assertion
+convenient package called a @trait@, which can then be used in an assertion
 instead of the individual constraints.
 \begin{cfa}
@@ -239,5 +245,5 @@
 functionality, like @sumable@, @listable@, \etc.
 
-Polymorphic structures and unions are defined by qualifying the aggregate type
+Polymorphic structures and unions are defined by qualifying an aggregate type
 with @forall@. The type variables work the same except they are used in field
 declarations instead of parameters, returns, and local variable declarations.
@@ -285,14 +291,15 @@
 coroutine CountUp {
 	unsigned int next;
-}
+};
 CountUp countup;
+for (10) sout | resume(countup).next; // print 10 values
 \end{cfa}
 Each coroutine has a @main@ function, which takes a reference to a coroutine
 object and returns @void@.
 %[numbers=left] Why numbers on this one?
-\begin{cfa}
+\begin{cfa}[numbers=left,numberstyle=\scriptsize\sf]
 void main(CountUp & this) {
-	for (unsigned int next = 0 ; true ; ++next) {
-		next = up;
+	for (unsigned int up = 0;; ++up) {
+		this.next = up;
 		suspend;$\label{suspend}$
 	}
@@ -300,6 +307,6 @@
 \end{cfa}
 In this function, or functions called by this function (helper functions), the
-@suspend@ statement is used to return execution to the coroutine's caller
-without terminating the coroutine's function.
+@suspend@ statement is used to return execution to the coroutine's resumer
+without terminating the coroutine's function(s).
 
 A coroutine is resumed by calling the @resume@ function, \eg @resume(countup)@.
@@ -323,7 +330,7 @@
 exclusion on a monitor object by qualifying an object reference parameter with
 @mutex@.
-\begin{cfa}
-void example(MonitorA & mutex argA, MonitorB & mutex argB);
-\end{cfa}
+\begin{lstlisting}[language=CFA,{moredelim=**[is][\color{red}]{@}{@}}]
+void example(MonitorA & @mutex@ argA, MonitorB & @mutex@ argB);
+\end{lstlisting}
 When the function is called, it implicitly acquires the monitor lock for all of
 the mutex parameters without deadlock.  This semantics means all functions with
@@ -355,5 +362,5 @@
 {
 	StringWorker stringworker; // fork thread running in "main"
-} // <- implicitly join with thread / wait for completion
+} // implicitly join with thread / wait for completion
 \end{cfa}
 The thread main is where a new thread starts execution after a fork operation
Index: doc/theses/andrew_beach_MMath/uw-ethesis.tex
===================================================================
--- doc/theses/andrew_beach_MMath/uw-ethesis.tex	(revision 417e8eaa44760977da4cbd577e921dc2017e11ab)
+++ doc/theses/andrew_beach_MMath/uw-ethesis.tex	(revision fa7dbf1935a3c62d39510a874ce75acf6c74a52c)
@@ -210,5 +210,6 @@
 \lstMakeShortInline@
 \lstset{language=CFA,style=cfacommon,basicstyle=\linespread{0.9}\tt}
-\lstset{moredelim=**[is][\protect\color{red}]{@}{@}}
+% PAB causes problems with inline @=
+%\lstset{moredelim=**[is][\protect\color{red}]{@}{@}}
 % Annotations from Peter:
 \newcommand{\PAB}[1]{{\color{blue}PAB: #1}}
