Index: doc/theses/jiada_liang_MMath/CFAenum.tex
===================================================================
--- doc/theses/jiada_liang_MMath/CFAenum.tex	(revision 07e9df1e21fb57bb093460e2671a8b1e2add9d74)
+++ doc/theses/jiada_liang_MMath/CFAenum.tex	(revision ec20ab955a5e90eda7cf9217db6a7c54ed964e01)
@@ -11,5 +11,5 @@
 
 C already provides @const@-style aliasing using the unnamed enumerator \see{\VRef{s:TypeName}}, even if the name @enum@ is misleading (@const@ would be better).
-Given the existence of this form, it is straightforward to extend it with types other than integers.
+Given the existence of this form, it is straightforward to extend it with types other than @int@.
 \begin{cfa}
 enum E { Size = 20u, PI = 3.14159L, Jack = L"John" };
@@ -21,8 +21,8 @@
 
 
-\section{Enumerator Unscoping}
-\label{s:EnumeratorUnscoping}
-
-In C, unscoped enumerators presents a \newterm{naming problem} when multiple enumeration types appear in the same scope with duplicate enumerator names.
+\section{Enumerator Visibility}
+\label{s:EnumeratorVisibility}
+
+In C, unscoped enumerators present a \newterm{naming problem} when multiple enumeration types appear in the same scope with duplicate enumerator names.
 There is no mechanism in C to resolve these naming conflicts other than renaming one of the duplicates, which may be impossible.
 
@@ -33,5 +33,5 @@
 enum E1 { First, Second, Third, Fourth };
 enum E2 { @Fourth@, @Third@, @Second@, @First@ }; $\C{// same enumerator names}$
-E1 p() { return Third; }				$\C{// correctly resolved duplicate names}$
+E1 p() { return Third; }				$\C{// return}$
 E2 p() { return Fourth; }
 void foo() {
@@ -54,5 +54,5 @@
 enum RGB @!@ { Red, Green, Blue };
 \end{cfa}
-Now the enumerators \emph{must} be qualified with the associated enumeration.
+Now the enumerators \emph{must} be qualified with the associated enumeration type.
 \begin{cfa}
 Week week = @Week.@Mon;
@@ -68,5 +68,5 @@
 }
 \end{cfa}
-As in Section~\ref{s:EnumeratorUnscoping}, opening multiple scoped enumerations in a @with@ can result in duplicate enumeration names, but \CFA implicit type resolution and explicit qualification/casting handles ambiguities.
+As in Section~\ref{s:EnumeratorVisibility}, opening multiple scoped enumerations in a @with@ can result in duplicate enumeration names, but \CFA implicit type resolution and explicit qualification/casting handle ambiguities.
 
 
@@ -243,5 +243,5 @@
 \end{cfa}
 which make @Third == First@ and @Fourth == Second@, causing a compilation error because of duplicase @case@ clauses.
-To better match with programmer intuition, \CFA toggles between value and position semantics depneding on the language context.
+To better match with programmer intuition, \CFA toggles between value and position semantics depending on the language context.
 For conditional clauses and switch statments, \CFA uses the robust position implementation.
 \begin{cfa}
Index: doc/theses/jiada_liang_MMath/background.tex
===================================================================
--- doc/theses/jiada_liang_MMath/background.tex	(revision 07e9df1e21fb57bb093460e2671a8b1e2add9d74)
+++ doc/theses/jiada_liang_MMath/background.tex	(revision ec20ab955a5e90eda7cf9217db6a7c54ed964e01)
@@ -74,9 +74,9 @@
 However, it is restricted to integral values.
 \begin{clang}
-enum { Size = 20, Max = 10, MaxPlus10 = Max + 10, Max10Plus1, Fred = -7 };
+enum { Size = 20, Max = 10, MaxPlus10 = Max + 10, @Max10Plus1@, Fred = -7 };
 \end{clang}
 Here, the aliased constants are: 20, 10, 20, 21, and -7.
 Direct initialization is by a compile-time expression generating a constant value.
-An enumerator without initialization is \newterm{auto-initialized}: from left to right, starting at zero or the next explicitly initialized constant, incrementing by @1@.
+Indirect initialization (without initialization, @Max10Plus1@) is \newterm{auto-initialized}: from left to right, starting at zero or the next explicitly initialized constant, incrementing by @1@.
 Because multiple independent enumerators can be combined, enumerators with the same values can occur.
 The enumerators are rvalues, so assignment is disallowed.
@@ -88,7 +88,7 @@
 \begin{cfa}
 typedef struct /* unnamed */  { ... } S;
-struct /* unnamed */  { ... } x, y, z;			$\C{// questionable}$
+struct /* unnamed */  { ... } x, y, z;	$\C{// questionable}$
 struct S {
-	union /* unnamed */ {						$\C{// unscoped fields}$
+	union /* unnamed */ {				$\C{// unscoped fields}$
 		int i;  double d ;  char ch;
 	};
@@ -107,5 +107,6 @@
 enum Week {
 	Thu@ = 10@, Fri, Sat, Sun,
-	Mon@ = 0@, Tue, Wed@,@ }; // terminating comma
+	Mon@ = 0@, Tue, Wed@,@			$\C{// terminating comma}$
+};
 \end{clang}
 Note, the comma in the enumerator list can be a terminator or a separator, allowing the list to end with a dangling comma.\footnote{
Index: doc/theses/jiada_liang_MMath/intro.tex
===================================================================
--- doc/theses/jiada_liang_MMath/intro.tex	(revision 07e9df1e21fb57bb093460e2671a8b1e2add9d74)
+++ doc/theses/jiada_liang_MMath/intro.tex	(revision ec20ab955a5e90eda7cf9217db6a7c54ed964e01)
@@ -135,4 +135,5 @@
 
 \subsection{Algebraic Data Type}
+\label{s:AlgebraicDataType}
 
 An algebraic data type (ADT)\footnote{ADT is overloaded with abstract data type.} is another language feature often linked with enumeration, where an ADT conjoins an arbitrary type, possibly a \lstinline[language=C++]{class} or @union@, and a named constructor.
Index: doc/theses/jiada_liang_MMath/relatedwork.tex
===================================================================
--- doc/theses/jiada_liang_MMath/relatedwork.tex	(revision 07e9df1e21fb57bb093460e2671a8b1e2add9d74)
+++ doc/theses/jiada_liang_MMath/relatedwork.tex	(revision ec20ab955a5e90eda7cf9217db6a7c54ed964e01)
@@ -18,5 +18,5 @@
 \end{comment}
 
-Enumeration-like features exist in many popular programming languages, both past and present, \eg Pascal~\cite{Pascal}, Ada~\cite{Ada}, \Csharp~\cite{Csharp}, OCaml~\cite{OCaml} \CC, Go~\cite{Go}, Haskell~\cite{Haskell}, Java~\cite{Java}, Modula-3~\cite{Modula-3}, Rust~\cite{Rust}, Swift~\cite{Swift}, Python~\cite{Python}.
+Enumeration-like features exist in many popular programming languages, both past and present, \eg Pascal~\cite{Pascal}, Ada~\cite{Ada}, \Csharp~\cite{Csharp}, OCaml~\cite{OCaml} \CC, Go~\cite{Go}, Haskell~\cite{Haskell}, Java~\cite{Java}, Rust~\cite{Rust}, Swift~\cite{Swift}, Python~\cite{Python}.
 Among theses languages, there are a large set of overlapping features, but each language has its own unique extensions and restrictions.
 
@@ -24,5 +24,5 @@
 \label{s:Pascal}
 
-Classic Pascal has the \lstinline[language=Pascal]{const} aliasing declaration binding a name to a constant literal/expression.
+Classic Pascal introduced the \lstinline[language=Pascal]{const} aliasing declaration binding a name to a constant literal/expression.
 \begin{pascal}
 const one = 0 + 1;   Vowels = set of (A,E,I,O,U);   NULL = NIL;
@@ -62,5 +62,5 @@
 type Traffic_Light is ( @Red@, Yellow, @Green@ );
 \end{ada}
-Like \CFA, Ada uses an advanced type-resolution algorithm, including the left-hand side of assignment, to disambiguate among overloaded identifiers.
+Like \CFA, Ada uses a type-resolution algorithm including the left-hand side of assignmente to disambiguate among overloaded identifiers.
 \VRef[Figure]{f:AdaEnumeration} shows how ambiguity is handled using a cast, \ie \lstinline[language=ada]{RGB'(Red)}.
 
@@ -97,5 +97,5 @@
 Ada provides an alias mechanism, \lstinline[language=ada]{renames}, for aliasing types, which is useful to shorten package identifiers.
 \begin{ada}
-OtherRed : RGB renames Red;
+@OtherRed@ : RGB renames Red;
 \end{ada}
 which suggests a possible \CFA extension to @typedef@.
@@ -160,5 +160,5 @@
 Hence, the ordering of the enumerators is crucial to provide the necessary ranges.
 
-An enumeration type can be used in the Ada \lstinline[language=ada]{case} (all enumerators must appear or a default) or iterating constructs.
+An enumeration type can be used in the Ada \lstinline[language=ada]{case} (all enumerators must appear or a @default@) or iterating constructs.
 \begin{cquote}
 \setlength{\tabcolsep}{15pt}
@@ -241,5 +241,5 @@
 whereas C @const@ declarations without @static@ are marked @R@.
 
-The following \CC non-backwards compatible changes are made \see{\cite[\S~7.2]{ANSI98:C++}}.
+The following \CC non-backwards compatible changes are made \see{\cite[\S~7.2]{ANSI98:c++}}.
 \begin{cquote}
 Change: \CC objects of enumeration type can only be assigned values of the same enumeration type.
@@ -248,5 +248,5 @@
 \begin{c++}
 enum color { red, blue, green };
-color c = 1;			 				$\C{// valid C, invalid C++}$
+color c = 1;			 				$\C{// valid C, invalid c++}$
 \end{c++}
 \textbf{Rationale}: The type-safe nature of \CC. \\
@@ -263,5 +263,5 @@
 enum e { A };
 sizeof(A) == sizeof(int)		 		$\C{// in C}$
-sizeof(A) == sizeof(e)		 			$\C{// in C++}$
+sizeof(A) == sizeof(e)		 			$\C{// in c++}$
 /* and sizeof(int) is not necessary equal to sizeof(e) */
 \end{c++}
@@ -279,5 +279,8 @@
 int i = A;    i = e; 					$\C{// implicit casts to int}$
 \end{c++}
-\CC{11} added a scoped enumeration, \lstinline[language=c++]{enum class} (or \lstinline[language=c++]{enum struct}), where the enumerators are accessed using type qualification.
+\CC{11} added a scoped enumeration, \lstinline[language=c++]{enum class} (or \lstinline[language=c++]{enum struct})\footnote{
+The use of keyword \lstinline[language=c++]{class} is resonable because default visibility is \lstinline[language=c++]{private} (scoped).
+However, default visibility for \lstinline[language=c++]{struct} is \lstinline[language=c++]{public} (unscoped) making it an odd choice.},
+where the enumerators are accessed using type qualification.
 \begin{c++}
 enum class E { A, B, C };
@@ -291,5 +294,5 @@
 E e = A;    e = B;						$\C{// direct access}$
 \end{c++}
-\CC{11} added the ability to explicitly declare the underlying \emph{integral} type for \lstinline[language=c++]{enum class}.
+\CC{11} added the ability to explicitly declare only an underlying \emph{integral} type for \lstinline[language=c++]{enum class}.
 \begin{c++}
 enum class RGB @: long@ { Red, Green, Blue };
@@ -302,7 +305,35 @@
 char ch = rgb::Red;   ch = crgb;		$\C{// error}$
 \end{c++}
-Finally, enumerations can be used in the @switch@ statement but there is no mechanism to iterate through an enumeration.
-An enumeration type cannot declare an array dimension but can be used as a subscript.
-There is no mechanism to subtype or inherit from enumerations.
+An enumeration can be used in the @if@ and @switch@ statements.
+\begin{cquote}
+\setlength{\tabcolsep}{15pt}
+\begin{tabular}{@{}ll@{}}
+\begin{c++}
+if ( @day@ <= Fri )
+	cout << "weekday" << endl;
+
+
+
+
+\end{c++}
+&
+\begin{c++}
+switch ( @day@ ) {
+  case Mon: case Tue: case Wed: case Thu: case Fri:
+	cout << "weekday" << endl; break;
+  case Sat: case Sun:
+	cout << "weekend" << endl; break;
+}
+\end{c++}
+\end{tabular}
+\end{cquote}
+However, there is no mechanism to iterate through an enumeration without an unsafe cast and it does not understand the enumerator values.
+\begin{c++}
+enum Week { Mon, Tue, Wed, Thu = 10, Fri, Sat, Sun };
+for ( Week d = Mon; d <= Sun; d = @(Week)(d + 1)@ ) cout << d << ' ';
+0 1 2 @3 4 5 6 7 8 9@ 10 11 12 13
+\end{c++}
+An enumeration type cannot declare an array dimension but an enumerator can be used as a subscript.
+There is no mechanism to subtype or inherit from an enumeration.
 
 
@@ -311,115 +342,113 @@
 
 % https://www.tutorialsteacher.com/codeeditor?cid=cs-mk8Ojx
-
-\Csharp is a dynamically-typed programming-language with a scoped, integral enumeration-type similar to the C/\CC enumeration.
+% https://learn.microsoft.com/en-us/dotnet/api/system.enum?view=net-8.0
+% https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/enums
+
+\Csharp is a dynamically-typed programming-language with a scoped, integral enumeration similar to \CC \lstinline[language=C++]{enum class}.
 \begin{csharp}
-enum Weekday : byte { Mon, Tue, Wed, Thu@ = 10@, Fri, Sat, Sun@,@ };
+enum Week : @long@ { Mon, Tue, Wed, Thu@ = 10@, Fri, Sat, Sun@,@ } // terminating comma
+enum RGB { Red, Green, Blue }
 \end{csharp}
-The default underlying type is @int@, with auto-incrementing, implicit/explicit initialization, terminator comma, and optional integral typing (default @int@).
-A method cannot be defined in an enumeration type.
-As well, there is an explicit bidirectional conversion between an enumeration and its integral type, and an implicit conversion to the enumerator label in display contexts.
+The default underlying integral type is @int@ (no @char@), with auto-incrementing, implicit/explicit initialization, and terminating comma.
+A method cannot be defined in an enumeration type (extension methods are possible).
+There is an explicit bidirectional conversion between an enumeration and its integral type, and an implicit conversion to the enumerator label in display contexts.
 \begin{csharp}
-int day = (int)Weekday.Fri;		$\C{// day == 10}$
-Weekday weekday = (Weekdays)42;		$\C{// weekday == 42, logically invalid}$
-Console.WriteLine( Weekday.Fri ); $\C{// print Fri}$
-string mon = Weekday.Mon.ToString(); $\C{// mon == "Mon"}$
+int iday = (int)Week.Fri;			$\C{// day == 11}$
+Week day = @(Week)@42;				$\C{// day == 42, unsafe}$
+string mon = Week.Mon.ToString();	$\C{// mon == "Mon"}$
+RGB rgb = RGB.Red;					$\C{// rgb == "Red"}$
+day = @(Week)@rgb;					$\C{// day == "Mon", unsafe}$
+Console.WriteLine( Week.Fri );		$\C{// print label Fri}$
 \end{csharp}
-
-The @Enum.GetValues@ pseudo-method retrieves an array of the enumeration constants for looping over an enumeration type or variable (expensive operation).
+The majority of the integral operators (relational and arithmetic) work with enumerations, except @*@ and @/@.
 \begin{csharp}
-foreach ( Weekday constant in @Enum.GetValues@( typeof(Weekday) ) ) {
-	Console.WriteLine( constant + " " + (int)constant ); // label, position
-}
+day = day++ - 5;					$\C{// unsafe}$
+day = day & day;
 \end{csharp}
 
-The @Flags@ attribute creates a bit-flags enumeration, allowing bitwise operators @&@, @|@, @~@ (complement), @^@ (xor).
+An enumeration can be used in the @if@ and @switch@ statements.
+\begin{cquote}
+\setlength{\tabcolsep}{15pt}
+\begin{tabular}{@{}ll@{}}
 \begin{csharp}
-@[Flags]@ public enum Weekday {
-	None = 0x0, Mon = 0x1, Tue = 0x2, Wed = 0x4,
-	Thu = 0x8, Fri = 0x10, Sat = 0x20, Sun = 0x40,
-	Weekend = @Sat | Sun@,
-	Weekdays = @Mon | Tue | Wed | Thu | Fri@
-}
-Weekday meetings = @Weekday.Mon | Weekday.Wed@; // 0x5
-\end{csharp}
-
-\VRef[Figure]{CsharpFreeVersusClass} shows an enumeration with free routines for manipulation, and embedding the enumeration and operations into an enumeration class.
-The key observation is that an enumeration class is just a structuring mechanism without any additional semantics.
-
-% https://learn.microsoft.com/en-us/dotnet/api/system.enum?view=net-8.0
-
-\begin{figure}
-\centering
-\begin{tabular}{@{}l|l@{}}
-\multicolumn{1}{@{}c|}{non-object oriented} & \multicolumn{1}{c@{}}{object oriented} \\
-\hline
-\begin{csharp}
-public class Program {
-
-	enum Weekday {
-		Mon, Tue, Wed, Thu, Fri, Sat, Sun };
-
-	static bool isWeekday( Weekday wd ) {
-		return wd <= Weekday.Fri;
-	}
-	static bool isWeekend( Weekday wd ) {
-		return Weekday.Sat <= wd;
-	}
-
-
-	public static void Main() {
-		Weekday day = Weekday.Sat;
-
-		Console.WriteLine( isWeekday( day ) );
-		Console.WriteLine( isWeekend( day ) );
-	}
-}
+if ( @day@ <= Week.Fri )
+	Console.WriteLine( "weekday" );
+
+
+
+
+
 \end{csharp}
 &
 \begin{csharp}
-public class Program {
-	public @class@ WeekDay : Enumeration {
-		public enum Day {
-				Mon, Tue, Wed, Thu, Fri, Sat, Sun };
-		public enum Day2 : Day {
-				XXX, YYY };
-		Day day;
-		public bool isWeekday() {
-			return day <= Day.Fri;
-		}
-		public bool isWeekend() {
-			return day > Day.Fri;
-		}
-		public WeekDay( Day d ) { day = d; }
-	}
-	public static void Main() {
-		WeekDay cday = new
-				WeekDay( WeekDay.Day.Sat );
-		Console.WriteLine( cday.isWeekday() );
-		Console.WriteLine( cday.isWeekend() );
-	}
+switch ( @day@ ) {
+  case Week.Mon: case Week.Tue: case Week.Wed:
+  case Week.Thu: case Week.Fri:
+	Console.WriteLine( "weekday" ); break;
+  case Week.Sat: case Week.Sun:
+	Console.WriteLine( "weekend" ); break;
 }
 \end{csharp}
 \end{tabular}
-\caption{\Csharp: Free Routine Versus Class Enumeration}
-\label{CsharpFreeVersusClass}
-\end{figure}
+\end{cquote}
+However, there is no mechanism to iterate through an enumeration without an unsafe cast to increment and positions versus values is not handled.
+\begin{csharp}
+for ( Week d = Mon; d <= Sun; @d += 1@ ) {
+	Console.Write( d + " " );
+}
+Mon Tue Wed @3 4 5 6 7 8 9@ Thu Fri Sat Sun
+\end{csharp}
+The @Enum.GetValues@ pseudo-method retrieves an array of the enumeration constants for looping over an enumeration type or variable (expensive operation).
+\begin{csharp}
+foreach ( Week d in @Enum.GetValues@( typeof(Week) ) ) {
+	Console.WriteLine( d + " " + (int)d + " " ); // label, position
+}
+Mon 0, Tue 1, Wed 2, Thu 10, Fri 11, Sat 12, Sun 13,
+\end{csharp}
+
+An enumeration type cannot declare an array dimension but an enumerator can be used as a subscript.
+There is no mechanism to subtype or inherit from an enumeration.
+
+The @Flags@ attribute creates a bit-flags enumeration, making bitwise operators @&@, @|@, @~@ (complement), @^@ (xor) sensible.
+\begin{csharp}
+@[Flags]@ public enum Week {
+	None = 0x0, Mon = 0x1, Tue = 0x2, Wed = 0x4,
+	Thu = 0x8, Fri = 0x10, Sat = 0x20, Sun = 0x40,
+	Weekdays = @Mon | Tue | Wed | Thu | Fri@ $\C{// Weekdays == 0x1f}$
+	Weekend = @Sat | Sun@,			$\C{// Weekend == 0x60}$
+}
+Week meetings = @Week.Mon | Week.Wed@; $\C{// 0x5}$
+\end{csharp}
 
 
 \section{Golang}
 
-Golang provides pseudo-enumeration similar to classic Pascal \lstinline[language=pascal]{const}, binding a name to a constant literal/expression.
+Golang has a no enumeration.
+It has @const@ aliasing declarations, similar to \CC \see{\VRef{s:C++RelatedWork}}, for basic types with type inferencing and static initialization (constant expression).
 \begin{Go}
-const ( R = 0; G; B )					$\C{// implicit: 0 0 0}$
-const ( Fred = "Fred"; Mary = "Mary"; Jane = "Jane" ) $\C{// explicit: Fred Mary Jane}$
+const R @int@ = 0;  const G @uint@ = 1;  const B = 2; $\C{// explicit typing and type inferencing}$
+const Fred = "Fred";  const Mary = "Mary";  const Jane = "Jane";
+const S = 0;  const T = 0;
+const USA = "USA";  const U = "USA";
+const V = 3.1;  const W = 3.1;
+\end{Go}
+Since these declarations are unmutable variables, they are unscoped and Golang has no overloading.
+
+Golang provides an enumeration-like feature to group together @const@ declaration into a block and introduces a form of auto-initialization.
+\begin{Go}
+const ( R = 0; G; B )					$\C{// implicit initialization: 0 0 0}$
+const ( Fred = "Fred"; Mary = "Mary"; Jane = "Jane" ) $\C{// explicit initialization: Fred Mary Jane}$
 const ( S = 0; T; USA = "USA"; U; V = 3.1; W ) $\C{// type change, implicit/explicit: 0 0 USA USA 3.1 3.1}$
 \end{Go}
-Constant identifiers are unscoped and must be unique (no overloading).
-The first enumerator \emph{must} be explicitly initialized;
-subsequent enumerators can be implicitly or explicitly initialized.
-Implicit initialization is the previous (predecessor) enumerator value.
-
-Auto-incrementing is supported by the keyword \lstinline[language=Go]{iota}, available only in the \lstinline[language=Go]{const} declaration.
-The \lstinline[language=Go]{iota} is a \emph{per \lstinline[language=golang]{const} declaration} integer counter, starting at zero and implicitly incremented by one for each \lstinline[language=golang]{const} identifier (enumerator).
+The first identifier \emph{must} be explicitly initialized;
+subsequent identifiers can be implicitly or explicitly initialized.
+Implicit initialization is the \emph{previous} (predecessor) identifier value.
+
+Each @const@ declaration provides an implicit integer counter starting at zero, called \lstinline[language=Go]{iota}.
+Using \lstinline[language=Go]{iota} outside of a @const@ block always sets the identifier to zero.
+\begin{Go}
+const R = iota;							$\C{// 0}$
+\end{Go}
+Inside a @const@ block, \lstinline[language=Go]{iota} is implicitly incremented for each \lstinline[language=golang]{const} identifier and used to initialize the next uninitialized identifier.
 \begin{Go}
 const ( R = @iota@; G; B )				$\C{// implicit: 0 1 2}$
@@ -430,24 +459,26 @@
 const ( O1 = iota + 1; @_@; O3; @_@; O5 ) // 1, 3, 5 
 \end{Go}
-Auto-incrementing stops after an explicit initialization.
+Auto-initialization reverts from \lstinline[language=Go]{iota} to the previous value after an explicit initialization, but auto-incrementing of \lstinline[language=Go]{iota} continues.
 \begin{Go}
 const ( Mon = iota; Tue; Wed; // 0, 1, 2
-	@Thu = 10@; Fri; Sat; Sun ) // 10, 10, 10, 10
+		@Thu = 10@; Fri; Sat; Sun = itoa ) // 10, 10, 10, 6
 \end{Go}
-Auto-incrementing can be restarted with an expression containing \emph{one} \lstinline[language=Go]{iota}.
+Auto-initialization from \lstinline[language=Go]{iota} is restarted and \lstinline[language=Go]{iota} reinitialized with an expression containing as most \emph{one} \lstinline[language=Go]{iota}.
 \begin{Go}
-const ( V1 = iota; V2; @V3 = 7;@ V4 = @iota@; V5 ) // 0 1 7 3 4
+const ( V1 = iota; V2; @V3 = 7;@ V4 = @iota@ + 1; V5 ) // 0 1 7 4 5
 const ( Mon = iota; Tue; Wed; // 0, 1, 2
-	@Thu = 10;@ Fri = @iota - Wed + Thu - 1@; Sat; Sun ) // 10, 11, 12, 13
+		@Thu = 10;@ Fri = @iota - Wed + Thu - 1@; Sat; Sun ) // 10, 11, 12, 13
 \end{Go}
-Note, \lstinline[language=Go]{iota} is advanced for an explicitly initialized enumerator, like the underscore @_@ identifier.
+Here, @V4@ and @Fri@ restart auto-incrementing from \lstinline[language=Go]{iota} and reset \lstinline[language=Go]{iota} to 4 and 11, respectively, because of the intialization expressions containing \lstinline[language=Go]{iota}.
+Note, because \lstinline[language=Go]{iota} is incremented for an explicitly initialized identifier or @_@,
+at @Fri@ \lstinline[language=Go]{iota} is 4 requiring the minus one to compute the value for @Fri@.
 
 Basic switch and looping are possible.
 \begin{cquote}
-\setlength{\tabcolsep}{15pt}
+\setlength{\tabcolsep}{20pt}
 \begin{tabular}{@{}ll@{}}
 \begin{Go}
-day := Mon;
-switch day {
+day := Mon;	// := $\(\Rightarrow\)$ type inferencing
+switch @day@ {
   case Mon, Tue, Wed, Thu, Fri:
 	fmt.Println( "weekday" );
@@ -459,5 +490,5 @@
 \begin{Go}
 
-for i := Mon; i <= Sun; i += 1 {
+for i := @Mon@; i <= @Sun@; i += 1 {
 	fmt.Println( i )
 }
@@ -470,163 +501,207 @@
 However, the loop prints the values from 0 to 13 because there is no actual enumeration.
 
+A constant variable can be used as an array dimension or a subscript.
+\begin{Go}
+var ar[@Sun@] int
+ar[@Mon@] = 3
+\end{Go}
+
 
 \section{Java}
 
-Every enumeration in Java is an enumeration class.
-For a basic enumeration
+Java provides an enumeration using a specialized class.
+A basic Java enumeration is an opaque enumeration, where the enumerators are constants.
 \begin{Java}
-enum Weekday { Mon, Tue, Wed, Thu, Fri, Sat, Sun };
-Weekday day = Weekday.Sat;
+enum Week {
+	Mon, Tue, Wed, Thu, Fri, Sat, Sun;
+}
+Week day = Week.Sat;
 \end{Java}
-the scoped enumerators are an ordered list of @final@ methods of type integer, ordered left to right starting at 0, increasing by 1.
-The value of an enumeration instance is restricted to the enumeration's enumerators.
-There is an implicit @int@ variable in the enumeration used to store the value of an enumeration instance.
-The position (ordinal) and label are accessible, where the value is the same as the position.
+The enumerators members are scoped and cannot be made \lstinline[language=java]{public}, hence require qualification.
+The value of an enumeration instance is restricted to its enumerators.
+
+The position (ordinal) and label are accessible but there is no value.
 \begin{Java}
-System.out.println( day.!ordinal()! + " " + day.!name()! ); // 5 Sat
+System.out.println( day.!ordinal()! + " " + !day! + " " + day.!name()! );
+5 Sat Sat
 \end{Java}
-There is an inverse function @valueOf@ from string to enumerator.
+Since @day@ has no value, it prints its label (name).
+The member @valueOf@ is the inverse of @name@ converting a string to enumerator.
 \begin{Java}
-day = Weekday.valueOf( "Wed" );
+day = Week.valueOf( "Wed" );
 \end{Java}
-There are no implicit conversions to/from an enumerator and its underlying type.
-Like \Csharp, \VRef[Figure]{f:JavaFreeVersusClass} shows the same example for an enumeration with free routines for manipulation, and embedding the enumeration and operations into an enumeration class.
-
-\begin{figure}
-\centering
-\begin{tabular}{@{}l|l@{}}
-\multicolumn{1}{@{}c|}{non-object oriented} & \multicolumn{1}{c@{}}{object oriented} \\
-\hline
+Extra members can be added to provide specialized operations.
 \begin{Java}
-enum Weekday !{!
-	Mon, Tue, Wed, Thu, Fri, Sat, Sun !}!;
-
-static boolean isWeekday( Weekday wd ) {
-	return wd.ordinal() <= Weekday.Fri.ordinal();
-}
-static boolean isWeekend( Weekday wd ) {
-	return Weekday.Fri.ordinal() < wd.ordinal();
-}
-
-public static void main( String[] args ) {
-	Weekday day = Weekday.Sat;
-	System.out.println( isWeekday( day ) );
-	System.out.println( isWeekend( day ) );
-}
+public boolean isWeekday() { return !ordinal()! <= Fri.ordinal(); }
+public boolean isWeekend() { return Fri.ordinal() < !ordinal()!; }
+\end{Java}
+Notice the unqualified calls to @ordinal@ in the members implying a \lstinline[language=Java]{this} to some implicit implementation variable, likely an @int@.
+
+Enumerator values require an enumeration type (any Java type may be used) and implementation member.
+\begin{Java}
+enum Week {
+	Mon!(1)!, Tue!(2)!, Wed!(3)!, Thu!(4)!, Fri!(5)!, Sat!(6)!, Sun!(7)!; // must appear first
+	private !long! day;					$\C{// enumeration type and implementation member}$
+	private Week( !long! d ) { day = d; } $\C{// enumerator initialization}$
+};
+Week day = Week.Sat;
+\end{Java}
+The position, value, and label are accessible.
+\begin{Java}
+System.out.println( !day.ordinal()! + " " + !day.day! + " " + !day.name()! );
+5 6 Sat
+\end{Java}
+If the implementation member is \lstinline[language=Java]{public}, the enumeration is unsafe, as any value of the underlying type can be assigned to it, \eg @day = 42@.
+The implementation constructor must be private since it is only used internally to initialize the enumerators.
+Initialization occurs at the enumeration-type declaration for each enumerator in the first line.
+
+Enumerations can be used in the @if@ and @switch@ statements but only for equality tests.
+\begin{cquote}
+\setlength{\tabcolsep}{15pt}
+\begin{tabular}{@{}ll@{}}
+\begin{Java}
+if ( !day! == Week.Fri )
+	System.out.println( "Fri" );
+
+
+
+
 \end{Java}
 &
 \begin{Java}
-enum Weekday !{!
-	Mon, Tue, Wed, Thu, Fri, Sat, Sun;
-
-	public boolean isWeekday() {
-		return ordinal() <= Weekday.Fri.ordinal();
-	}
-	public boolean isWeekend() {
-		return Weekday.Fri.ordinal() < ordinal();
-	}
-!}!
-public static void main( String[] args ) {
-	WeekDay day = WeekDay.Sat;
-	System.out.println( day.isWeekday() );
-	System.out.println( day.isWeekend() );
+switch ( !day! ) {
+  case Mon: case Tue: case Wed: case Thu: case Fri:
+	System.out.println( "weekday" );  break;
+  case Sat: case Sun:
+	System.out.println( "weekend" );  break;
 }
 \end{Java}
 \end{tabular}
-\caption{Java: Free Routine Versus Class Enumeration}
-\label{f:JavaFreeVersusClass}
-\end{figure}
-
-To explicitly assign enumerator values and/or use a non-@int@ enumeration type (any Java type may be used), the enumeration must specify an explicit type in the enumeration class and a constructor.
+\end{cquote}
+Notice enumerators in the @switch@ statement do not require qualification.
+
+There are no arithemtic operations on enumerations, so there is no arithmetic way to iterate through an enumeration without making the implementation type \lstinline[language=Java]{public}.
+Like \Csharp, looping over an enumeration is done using method @values@, which returns an array of enumerator values (expensive operation).
 \begin{Java}
-enum Weekday {
-	Mon!(1)!, Tue!(2)!, Wed!(3)!, Thu!(4)!, Fri!(5)!, Sat!(6)!, Sun!(7)!; // must appear first
-	private !long! day;					$\C{// underlying enumeration type}$
-	private Weekday( !long! d ) { day = d; } $\C{// used to initialize enumerators}$
-};
-Weekday day = Weekday.Sat;
-\end{Java}
-If an enumerator initialization is a runtime expression, the expression is executed once at the point the enumeration is declaraed.
-
-The position, value, and label are accessible.
-\begin{Java}
-System.out.println( !day.ordinal()! + " " + !day.day! + " " + !day.name()! );  // 5 6 Sat
-\end{Java}
-The constructor is private so only initialization or assignment can be used to set an enumeration, which ensures only corresponding enumerator values are allowed.
-
-An enumeration can appear in a @switch@ statement, but no ranges.
-\begin{Java}
-switch ( day ) {
-  case Mon: case Tue: case Wed: case Thu: case Fri:
-	System.out.println( "weekday" );
-	break;
-  case Sat: case Sun:
-	System.out.println( "weekend" );
-	break;
-}
-\end{Java}
-Like \Csharp, looping over an enumeration is done using method @values@, which returns the array of enumerator values (expensive operation).
-\begin{Java}
-for ( Weekday iday : Weekday.values() ) {
-	System.out.print( iday.ordinal() + iday.day + " " +  iday.name() + ",  " );
+for ( Week d : Week.values() ) {
+	System.out.print( d.ordinal() + d.day + " " +  d.name() + ",  " );
 }
 0 1 Mon,  1 2 Tue,  2 3 Wed,  3 4 Thu,  4 5 Fri,  5 6 Sat,  6 7 Sun,  
 \end{Java}
 
-As well, Java provides an @EnumSet@ where the underlying type is an efficient set of bits, one per enumeration \see{\Csharp \lstinline{Flags}, \VRef{s:Csharp}}, providing (logical) operations on groups of enumerators.
+An enumeration type cannot declare an array dimension nor can an enumerator be used as a subscript.
+Enumeration inheritence is disallowed because an enumeration is \lstinline[language=Java]{final}.
+
+Java provides an @EnumSet@ where the underlying type is an efficient set of bits, one per enumeration \see{\Csharp \lstinline{Flags}, \VRef{s:Csharp}}, providing (logical) operations on groups of enumerators.
 There is also a specialized version of @HashMap@ with enumerator keys, which has performance benefits.
 
-Enumeration inheritence is disallowed because an enumeration is @final@.
-
-
-
-\section{Modula-3}
-
-
 
 \section{Rust}
+
 % https://doc.rust-lang.org/reference/items/enumerations.html
 
-Rust provides a scoped enumeration based on variant types.
-% An enumeration, also referred to as an enum, is a simultaneous definition of a nominal enumerated type as well as a set of constructors, that can be used to create or pattern-match values of the corresponding enumerated type.
-An enumeration without constructors is called field-less.
+Rust @enum@ provides two largely independent mechanisms: an ADT and an enumeration.
+When @enum@ is an ADT, pattern matching is used to discriminate among the variant types.
+\begin{cquote}
+\sf\setlength{\tabcolsep}{20pt}
+\begin{tabular}{@{}ll@{}}
 \begin{rust}
-enum Week { Mon, Tues, Wed, Thu, Fri, Sat, Sun@,@ }
-let mut week: Week = Week::Mon;
-week = Week::Fri;
+struct S {
+	i : isize,  j : isize
+}
+enum @ADT@ {
+	I(isize),   // int
+	F(f64),   // float
+	S(S),     // struct
+}
 \end{rust}
-A field-less enumeration with only unit variants is called unit-only.
+&
 \begin{rust}
-enum Week { Mon = 0, Tues = 1, Wed = 2, Thu = 3, Fri = 4, Sat = 5, Sun = 6 }
+let mut s = S{ i : 3, j : 4 };
+let mut adt : ADT;
+adt = ADT::I(3);  adt = ADT::F(3.5);  adt = ADT::S(s); // init examples
+@match@ adt {
+	ADT::I(i) => println!( "{:?}", i ),
+	ADT::F(f) => println!( "{:?}", f ),
+	ADT::S(s) => println!( "{:?} {:?}", s.i, s.j ),
+}
 \end{rust}
-Enum constructors can have either named or unnamed fields:
-\begin{rust}
-enum Animal {
-	Dog( String, f64 ),
-	Cat{ name: String, weight: f64 },
-}
-let mut a: Animal = Animal::Dog("Cocoa".to_string(), 37.2);
-a = Animal::Cat { name: "Spotty".to_string(), weight: 2.7 };
-\end{rust}
-Here, @Dog@ is an @enum@ variant, whereas @Cat@ is a struct-like variant.
-
-Each @enum@ type has an implicit integer tag (discriminant), with a unique value for each variant type.
-Like a C enumeration, the tag values for the variant types start at 0 with auto incrementing.
-The tag is re-purposed for enumeration by allowing it to be explicitly set, and auto incrmenting continues from that value.
-\begin{cquote}
-\sf\setlength{\tabcolsep}{3pt}
-\begin{tabular}{rcccccccr}
-@enum@ Week \{	& Mon,	& Tue,	& Wed = 2,	& Thu = 10,	& Fri, 	& Sat = 5,	& Sun	& \};	\\
-\rm tags		& 0		& 1		& 2			& 10		& 11 	& 5			& 6		&		\\
 \end{tabular}
 \end{cquote}
-In general, the tag can only be read as an opaque reference for comparison.
+When the variant types are the unit type, the ADT is still not an enumeration because there is no enumerating \see{\VRef{s:AlgebraicDataType}}.
 \begin{rust}
-if mem::discriminant(&week) == mem::discriminant(&Week::Mon) ...
+enum Week { Mon, Tues, Wed, Thu, Fri, Sat, Sun@,@ } // terminating comma
+let mut week : Week = Week::Mon;
+match week {
+	Week::Mon => println!( "Mon" ),
+	...
+	Week::Sun => println!( "Sun" ),
+}
 \end{rust}
-If the enumeration is unit-only, or field-less with no explicit discriminants and where only unit variants are explicit, then the discriminant is accessible with a numeric cast.
+
+However, Rust allows direct setting of the ADT constructor, which means it is actually a tag.
+\begin{cquote}
+\sf\setlength{\tabcolsep}{15pt}
+\begin{tabular}{@{}ll@{}}
 \begin{rust}
-if week as isize == Week::Mon as isize ...
+enum Week {
+	Mon, Tues, Wed, // start 0
+	Thu @= 10@, Fri,
+	Sat, Sun,
+}
+
 \end{rust}
+&
+\begin{rust}
+#[repr(u8)]
+enum ADT {
+	I(isize) @= 5@,  // ???
+	F(f64) @= 10@,
+	S(S) @= 0@,
+}
+\end{rust}
+\end{tabular}
+\end{cquote}
+Through this integral tag, it is possible to enumerate, and when all tags represent the unit type, it behaves like \CC \lstinline[language=C++]{enum class}.
+When tags represent non-unit types, Rust largely precludes accessing the tag because the semantics become meaningless.
+Hence, the two mechanisms are largely disjoint, and ony the enumeration component is discussed.
+
+In detail, the @enum@ type has an implicit integer tag (discriminant), with a unique value for each variant type.
+Direct initialization is by a compile-time expression generating a constant value.
+Indirect initialization (without initialization, @Fri@/@Sun@) is auto-initialized: from left to right, starting at zero or the next explicitly initialized constant, incrementing by @1@.
+There is an explicit cast from the tag to integer.
+\begin{rust}
+let mut mon : isize = Week::Mon as isize;
+\end{rust}
+An enumeration can be used in the @if@ and \lstinline[language=rust]{match} (@switch@) statements.
+\begin{cquote}
+\setlength{\tabcolsep}{8pt}
+\begin{tabular}{@{}ll@{}}
+\begin{c++}
+if @week as isize@ == Week::Mon as isize {
+	println!( "{:?}", week );
+}
+
+
+\end{c++}
+&
+\begin{c++}
+match @week@ {
+	Week::Mon | Week:: Tue | Week::Wed | Week::Thu
+		| Week::Fri => println!( "weekday" ),
+	Week::Sat | Week:: Sun => println!( "weekend" ),
+}
+\end{c++}
+\end{tabular}
+\end{cquote}
+However, there is no mechanism to iterate through an enumeration without an casting to integral and positions versus values is not handled.
+\begin{c++}
+for d in Week::Mon as isize ..= Week::Sun as isize {
+	print!( "{:?} ", d );
+}
+0 1 2 @3 4 5 6 7 8 9@ 10 11 12 13
+\end{c++}
+An enumeration type cannot declare an array dimension nor as a subscript.
+There is no mechanism to subtype or inherit from an enumeration.
 
 
@@ -2162,7 +2237,7 @@
 A basic variant is a list of nullary datatype constructors, which is like an unscoped, opaque enumeration.
 \begin{ocaml}
-type weekday = Mon | Tue | Wed | Thu | Fri | Sat | Sun
-let day : weekday @= Mon@				$\C{(* bind *)}$
-let take_class( d : weekday ) =
+type week = Mon | Tue | Wed | Thu | Fri | Sat | Sun
+let day : week @= Mon@				$\C{(* bind *)}$
+let take_class( d : week ) =
 	@match@ d with						$\C{(* matching *)}$
 		Mon | Wed -> Printf.printf "CS442\n" |
@@ -2175,8 +2250,8 @@
 The only operations are binding and pattern matching (equality), where the variant name is logically the implementation tag stored in the union for discriminating the value in the object storage.
 After compilation, variant names are mapped to an opague ascending intergral type discriminants, starting from 0.
-Here, function @take_class@ has a @weekday@ parameter, and returns @"CS442"@, if the weekday value is @Mon@ or @Wed@, @"CS343"@, if the value is @Tue@ or @Thu@, and @"Tutorial"@ for @Fri@.
-The ``@_@'' is a wildcard matching any @weekday@ value, so the function returns @"Take a break"@ for values @Sat@ or @Sun@, which are not matched by the previous cases.
+Here, function @take_class@ has a @week@ parameter, and returns @"CS442"@, if the week value is @Mon@ or @Wed@, @"CS343"@, if the value is @Tue@ or @Thu@, and @"Tutorial"@ for @Fri@.
+The ``@_@'' is a wildcard matching any @week@ value, so the function returns @"Take a break"@ for values @Sat@ or @Sun@, which are not matched by the previous cases.
 Since the variant has no type, it has a \newterm{0-arity constructor}, \ie no parameters.
-Because @weekday@ is a union of values @Mon@ to @Sun@, it is a \newterm{union type} in turns of the functional-programming paradigm. 
+Because @week@ is a union of values @Mon@ to @Sun@, it is a \newterm{union type} in turns of the functional-programming paradigm. 
 
 Each variant can have an associated heterogeneous type, with an n-ary constructor for creating a corresponding value.
@@ -2242,5 +2317,5 @@
 term "tag" further.
 
-<<Because weekday is a summation of values Mon to Sun, it is a sum type in
+<<Because week is a summation of values Mon to Sun, it is a sum type in
 turns of the functional-programming paradigm>>
 
@@ -2259,9 +2334,9 @@
 > I've marked 3 places with your name to shows places with enum ordering.
 >
-> type weekday = Mon | Tue | Wed | Thu | Fri | Sat | Sun
-> let day : weekday = Mon
-> let take_class( d : weekday ) =
+> type week = Mon | Tue | Wed | Thu | Fri | Sat | Sun
+> let day : week = Mon
+> let take_class( d : week ) =
 > 	if d <= Fri then				(* Gregor *)
-> 		Printf.printf "weekday\n"
+> 		Printf.printf "week\n"
 > 	else if d >= Sat then			(* Gregor *)
 > 		Printf.printf "weekend\n";
@@ -2474,5 +2549,5 @@
 loop			&		&		&		&		&		&		&		&	  	&		&		&		&		& \CM	\\
 \hline
-array			&		&		&		&		&		&		&		&	  	&		&		& \CM	&		& \CM	\\
+array/subscript	&		&		&		&		&		&		&		&	  	&		&		& \CM	&		& \CM	\\
 \hline
 subtype			&		&		&		&		&		&		&		&	  	&		&		&		&		& \CM	\\
