Index: doc/theses/jiada_liang_MMath/relatedwork.tex
===================================================================
--- doc/theses/jiada_liang_MMath/relatedwork.tex	(revision 736a38dedf9b0e28de1be78317e94889af77d502)
+++ doc/theses/jiada_liang_MMath/relatedwork.tex	(revision c0334059552de128bbf1ea6badf3c9d82681b382)
@@ -43,5 +43,5 @@
 \begin{pascal}
 Type @{$\color{red}\$$PACKENUM 1}@ SmallEnum = ( one, two, three );
-	    @{$\color{red}\$$PACKENUM 4}@ LargeEnum = ( BigOne, BigTwo, BigThree );
+		@{$\color{red}\$$PACKENUM 4}@ LargeEnum = ( BigOne, BigTwo, BigThree );
 Var S : SmallEnum; { 1 byte }
 	  L : LargeEnum; { 4 bytes}
@@ -406,4 +406,5 @@
 Mon 0, Tue 1, Wed 2, Thu 10, Fri 11, Sat 12, Sun 13,
 \end{csharp}
+Hence, enumerating is not supplied directly by the enumeration, but indirectly through another enumerable type, array.
 
 An enumeration type cannot declare an array dimension but an enumerator can be used as a subscript.
@@ -535,5 +536,5 @@
 \begin{Java}
 public boolean isWeekday() { return !ordinal()! <= Fri.ordinal(); }
-public boolean isWeekend() { return Fri.ordinal() < !ordinal()!; }
+public boolean isWeekend() { return Sat.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@.
@@ -590,4 +591,5 @@
 0 1 Mon,  1 2 Tue,  2 3 Wed,  3 4 Thu,  4 5 Fri,  5 6 Sat,  6 7 Sun,  
 \end{Java}
+Like \Csharp, enumerating is supplied indirectly through another enumerable type, not via the enumeration.
 
 An enumeration type cannot declare an array dimension nor can an enumerator be used as a subscript.
@@ -602,33 +604,46 @@
 % https://doc.rust-lang.org/reference/items/enumerations.html
 
-Rust @enum@ provides two largely independent mechanisms: an ADT and an enumeration.
+Rust @enum@ provides two largely independent mechanisms from a single language feature: 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{tabular}{@{}l@{\hspace{30pt}}ll@{}}
 \begin{rust}
 struct S {
 	i : isize,  j : isize
 }
+let mut s = S{ i : 3, j : 4 };
 enum @ADT@ {
-	I(isize),   // int
-	F(f64),   // float
-	S(S),     // struct
+	I( isize ), $\C[1in]{// int}$
+	F( f64 ),   $\C{// float}$
+	S( S ),     $\C{// struct}\CRT$
 }
 \end{rust}
 &
 \begin{rust}
-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
+adt = ADT::I(3);  println!( "{:?}", adt );
+adt = ADT::F(3.5);  println!( "{:?}", adt );
+adt = ADT::S(s);  println!( "{:?}", adt );
 @match@ adt {
-	ADT::I(i) => println!( "{:?}", i ),
-	ADT::F(f) => println!( "{:?}", f ),
-	ADT::S(s) => println!( "{:?} {:?}", s.i, s.j ),
+	ADT::I( i ) => println!( "{:}", i ),
+	ADT::F( f ) => println!( "{:}", f ),
+	ADT::S( s ) => println!( "{:} {:}", s.i, s.j ),
 }
 \end{rust}
-\end{tabular}
-\end{cquote}
-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}
+I(3)
+F(3.5)
+S(S { i: 3, j: 4 })
+3 4
+
+
+
+
+
+\end{rust}
+\end{tabular}
+\end{cquote}
+Even 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}
 enum Week { Mon, Tues, Wed, Thu, Fri, Sat, Sun@,@ } // terminating comma
@@ -643,5 +658,5 @@
 However, Rust allows direct setting of the ADT constructor, which means it is actually a tag.
 \begin{cquote}
-\sf\setlength{\tabcolsep}{15pt}
+\setlength{\tabcolsep}{15pt}
 \begin{tabular}{@{}ll@{}}
 \begin{rust}
@@ -696,5 +711,5 @@
 \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.
+However, there is no mechanism to iterate through an enumeration without casting to integral and positions versus values is not handled.
 \begin{c++}
 for d in Week::Mon as isize ..= Week::Sun as isize {
@@ -711,356 +726,164 @@
 % https://www.programiz.com/swift/online-compiler
 
-A Swift enumeration provides a heterogenous set of enumerators, like a tagged @union@, where the field name is the enumerator and its list of type parameters form its type.
+Like Rust, Swift @enum@ provides two largely independent mechanisms from a single language feature: an ADT and an enumeration.
+When @enum@ is an ADT, pattern matching is used to discriminate among the variant types.
+\begin{cquote}
+\setlength{\tabcolsep}{20pt}
+\begin{tabular}{@{}l@{\hspace{55pt}}ll@{}}
 \begin{swift}
-enum Many {
-	case Mon, Tue, Wed, Thu, Fri, Sat, Sun // basic enumerator
-	case code( String ) // string enumerator
-	case tuple( Int, Int, Int ) // tuple enumerator
+struct S {
+	var i : Int,  j : Int
+}
+var s = S( i : 3, j : 5 )
+@enum@ ADT {
+	case I(Int)   $\C[1.125in]{// int}$
+	case F(Float) $\C{// float}$
+	case S(S)     $\C{// struct}\CRT$
+}
+\end{swift}
+&
+\begin{swift}
+var adt : ADT
+adt = .I( 3 );  print( adt )
+adt = .F( 3.5 );  print( adt )
+adt = .S( s );  print( adt )
+@switch@ adt {  // pattern matching
+	case .I(let i):  print( i )
+	case .F(let f):  print( f )
+	case .S(let s):  print( s.i, s.j )
+}
+\end{swift}
+&
+\begin{swift}
+I(3)
+F(3.5)
+S(S(i: 3, j: 5))
+3 5
+
+
+
+
+
+\end{swift}
+\end{tabular}
+\end{cquote}
+(Note, after an @adt@'s type is know, the enumerator is inferred without qualification, \eg @.I(3)@.)
+
+An enumeration is created when \emph{all} the enumerators are unit-type.
+\begin{swift}
+enum Week {
+	case Mon, Tue, Wed, Thu, Fri, Sat, Sun // unit-type
 };
-var day = Many.Sat; // qualification to resolve type
-print( day );
-day = .Wed // no qualification after type resolved
-print( day );
-day = .code( "ABC" );
-print( day );
-day = .tuple( 1, 2, 3 );
-print( day );
-
-Sat
-Wed
-code("ABC")
-tuple(1, 2, 3)
+var week : Week = Week.Mon;
 \end{swift}
-
-
-An enumeration defines a common type for a group of related values and enables you to work with those values in a type-safe way within your code.
-
-If you are familiar with C, you will know that C enumerations assign related names to a set of integer values.
-Enumerations in Swift are much more flexible, and don't have to provide a value for each case of the enumeration.
-If a value (known as a raw value) is provided for each enumeration case, the value can be a string, a character, or a value of any integer or floating-point type.
-
-Alternatively, enumeration cases can specify associated values of any type to be stored along with each different case value, much as unions or variants do in other languages.
-You can define a common set of related cases as part of one enumeration, each of which has a different set of values of appropriate types associated with it.
-
-Enumerations in Swift are first-class types in their own right.
-They adopt many features traditionally supported only by classes, such as computed properties to provide additional information about the enumeration's current value, and instance methods to provide functionality related to the values the enumeration represents.
-Enumerations can also define initializers to provide an initial case value;
-can be extended to expand their functionality beyond their original implementation; and can conform to protocols to provide standard functionality.
-
-For more about these capabilities, see Properties, Methods, Initialization, Extensions, and Protocols.
-
-\paragraph{Enumeration Syntax}
-
-
-Note:
-Swift enumeration cases don't have an integer value set by default, unlike languages like C and Objective-C.
-In the CompassPoint example above, @north@, @south@, @east@ and @west@ don't implicitly equal 0, 1, 2 and 3.
-Instead, the different enumeration cases are values in their own right, with an explicitly defined type of CompassPoint.
-
-Multiple cases can appear on a single line, separated by commas:
+As well, it is possible to type \emph{all} the enumerators with a common type, and set different values for each enumerator;
+for integral types, there is auto-incrementing.
+\begin{cquote}
+\setlength{\tabcolsep}{15pt}
+\begin{tabular}{@{}lll@{}}
 \begin{swift}
-enum Planet {
-	case mercury, venus, earth, mars, jupiter, saturn, uranus, neptune
-}
+enum WeekInt: @Int@ {
+	case Mon, Tue, Wed, Thu = 10, Fri,
+			Sat = 4, Sun // auto-incrementing
+};
 \end{swift}
-Each enumeration definition defines a new type.
-Like other types in Swift, their names (such as @CompassPoint@ and @Planet@) start with a capital letter.
-Give enumeration types singular rather than plural names, so that they read as self-evident:
+&
 \begin{swift}
-var directionToHead = CompassPoint.west
+enum WeekStr: @String@ {
+	case Mon = "MON", Tue, Wed, Thu, Fri,
+			Sat = "SAT", Sun
+};
 \end{swift}
-The type of @directionToHead@ is inferred when it's initialized with one of the possible values of @CompassPoint@.
-Once @directionToHead@ is declared as a @CompassPoint@, you can set it to a different @CompassPoint@ value using a shorter dot syntax:
+\end{tabular}
+\end{cquote}
+An enumeration only supports equality comparison between enumerator values, unless it inherits from @Comparable@, adding relational operators @<@, @<=@, @>@, and @>=@.
+
+An enumeration can have methods.
 \begin{swift}
-directionToHead = .east
+enum Week: Comparable {
+	case Mon, Tue, Wed, Thu, Fri, Sat, Sun // unit-type
+	func @isWeekday() -> Bool@ { return self <= .Fri }    // method
+	func @isWeekend() -> Bool@ { return .Sat <= self }  // method
+};
 \end{swift}
-The type of @directionToHead@ is already known, and so you can drop the type when setting its value.
-This makes for highly readable code when working with explicitly typed enumeration values.
-
-\paragraph{Matching Enumeration Values with a Switch Statement}
-
-You can match individual enumeration values with a switch statement:
+An enumeration can be used in the @if@ and @switch@ statements, where @switch@ must be exhaustive or have a @default@.
+\begin{cquote}
+\setlength{\tabcolsep}{15pt}
+\begin{tabular}{@{}ll@{}}
 \begin{swift}
-directionToHead = .south
-switch directionToHead {
-case .north:
-	print("Lots of planets have a north")
-case .south:
-	print("Watch out for penguins")
-case .east:
-	print("Where the sun rises")
-case .west:
-	print("Where the skies are blue")
-}
-// Prints "Watch out for penguins"
+if @week <= .Fri@ {
+	print( "weekday" );
+}
+
+
 \end{swift}
-You can read this code as:
-\begin{quote}
-"Consider the value of directionToHead.
-In the case where it equals @.north@, print "Lots of planets have a north".
-In the case where it equals @.south@, print "Watch out for penguins"."
-
-...and so on.
-\end{quote}
-As described in Control Flow, a switch statement must be exhaustive when considering an enumeration's cases.
-If the case for @.west@ is omitted, this code doesn't compile, because it doesn't consider the complete list of @CompassPoint@ cases.
-Requiring exhaustiveness ensures that enumeration cases aren't accidentally omitted.
-
-When it isn't appropriate to provide a case for every enumeration case, you can provide a default case to cover any cases that aren't addressed explicitly:
+&
 \begin{swift}
-let somePlanet = Planet.earth
-switch somePlanet {
-case .earth:
-	print("Mostly harmless")
-default:
-	print("Not a safe place for humans")
-}
-// Prints "Mostly harmless"
+switch @week@ {
+	case .Mon: print( "Mon" )
+	...
+	case .Sun: print( "Sun" )
+}
 \end{swift}
-
-\paragraph{Iterating over Enumeration Cases}
-
-For some enumerations, it's useful to have a collection of all of that enumeration's cases.
-You enable this by writing @CaseIterable@ after the enumeration's name.
-Swift exposes a collection of all the cases as an allCases property of the enumeration type.
-Here's an example:
+\end{tabular}
+\end{cquote}
+
+Enumerating is accomplished by inheriting from @CaseIterable@ without any associated values.
 \begin{swift}
-enum Beverage: CaseIterable {
-	case coffee, tea, juice
-}
-let numberOfChoices = Beverage.allCases.count
-print("\(numberOfChoices) beverages available")
-// Prints "3 beverages available"
+enum Week: Comparable, @CaseIterable@ {
+	case Mon, Tue, Wed, Thu, Fri, Sat, Sun // unit-type
+};
+var weeki : Week = Week.Mon;
+if weeki <= .Fri {
+	print( "weekday" );
+}
+for day in Week@.allCases@ { 
+	print( day, terminator:" " ) 
+}
+weekday
+Mon Tue Wed Thu Fri Sat Sun 
 \end{swift}
-In the example above, you write @Beverage.allCases@ to access a collection that contains all of the cases of the @Beverage@ enumeration.
-You can use @allCases@ like any other collection -- the collection's elements are instances of the enumeration type, so in this case they're Beverage values.
-The example above counts how many cases there are, and the example below uses a for-in loop to iterate over all the cases.
+The @enum.allCases@ property returns a collection of all the cases for looping over an enumeration type or variable (expensive operation).
+
+A typed enumeration is accomplished by inheriting from any Swift type, and accessing the underlying enumerator value is done with attribute @rawValue@.
+Type @Int@ has auto-incrementing from previous enumerator;
+type @String@ has auto-incrementing of the enumerator label.
+\begin{cquote}
+\setlength{\tabcolsep}{15pt}
+\begin{tabular}{@{}lll@{}}
 \begin{swift}
-for beverage in Beverage.allCases {
-	print(beverage)
-}
-// coffee
-// tea
-// juice
+enum WeekInt: @Int@, CaseIterable {
+	case Mon, Tue, Wed, Thu = 10, Fri,
+			Sat = 4, Sun // auto-incrementing
+};
+for day in WeekInt.allCases {
+	print( day@.rawValue@, terminator:" " ) 
+}
+0 1 2 10 11 4 5 
 \end{swift}
-The syntax used in the examples above marks the enumeration as conforming to the @CaseIterable@ protocol.
-For information about protocols, see Protocols.
-
-\paragraph{Associated Values}
-The examples in the previous section show how the cases of an enumeration are a defined (and typed) value in their own right.
-You can set a constant or variable to Planet.earth, and check for this value later.
-However, it's sometimes useful to be able to store values of other types alongside these case values.
-This additional information is called an associated value, and it varies each time you use that case as a value in your code.
-
-You can define Swift enumerations to store associated values of any given type, and the value types can be different for each case of the enumeration if needed.
-Enumerations similar to these are known as discriminated unions, tagged unions, or variants in other programming languages.
-
-For example, suppose an inventory tracking system needs to track products by two different types of barcode.
-Some products are labeled with 1D barcodes in UPC format, which uses the numbers 0 to 9.
-Each barcode has a number system digit, followed by five manufacturer code digits and five product code digits.
-These are followed by a check digit to verify that the code has been scanned correctly:
-
-Other products are labeled with 2D barcodes in QR code format, which can use any ISO 8859-1 character and can encode a string up to 2,953 characters long:
-
-It's convenient for an inventory tracking system to store UPC barcodes as a tuple of four integers, and QR code barcodes as a string of any length.
-
-In Swift, an enumeration to define product barcodes of either type might look like this:
+&
 \begin{swift}
-enum Barcode {
-	case upc(Int, Int, Int, Int)
-	case qrCode(String)
-}
+enum WeekStr: @String@, CaseIterable {
+	case Mon = "MON", Tue, Wed, Thu, Fri,
+			Sat = "SAT", Sun
+};
+for day in WeekStr.allCases { 
+	print( day@.rawValue@, terminator:" " ) 
+}
+MON Tue Wed Thu Fri SAT Sun 
 \end{swift}
-This can be read as:
-\begin{quote}
-"Define an enumeration type called Barcode, which can take either a value of upc with an associated value of type @(Int, Int, Int, Int)@, or a value of @qrCode@ with an associated value of type @String@."
-\end{quote}
-This definition doesn't provide any actual @Int@ or @String@ values -- it just defines the type of associated values that Barcode constants and variables can store when they're equal to @Barcode.upc@ or @Barcode.qrCode@.
-
-You can then create new barcodes using either type:
+\end{tabular}
+\end{cquote}
+
+There is a bidirectional conversion from typed enumerator to @rawValue@ and vise versa.
 \begin{swift}
-var productBarcode = Barcode.upc(8, 85909, 51226, 3)
+var weekInt : WeekInt = WeekInt.Mon;
+if let opt = WeekInt( rawValue: 0 ) {  // test optional return value
+	print( weekInt.rawValue, opt )  // 0 Mon
+} else {
+	print( "invalid weekday lookup" )
+}
 \end{swift}
-This example creates a new variable called @productBarcode@ and assigns it a value of @Barcode.upc@ with an associated tuple value of @(8, 85909, 51226, 3)@.
-
-You can assign the same product a different type of barcode:
-\begin{swift}
-productBarcode = .qrCode("ABCDEFGHIJKLMNOP")
-\end{swift}
-At this point, the original @Barcode.upc@ and its integer values are replaced by the new @Barcode.qrCode@ and its string value.
-Constants and variables of type Barcode can store either a @.upc@ or a @.qrCode@ (together with their associated values), but they can store only one of them at any given time.
-
-You can check the different barcode types using a switch statement, similar to the example in Matching Enumeration Values with a Switch Statement.
-This time, however, the associated values are extracted as part of the switch statement.
-You extract each associated value as a constant (with the let prefix) or a variable (with the var prefix) for use within the switch case's body:
-\begin{swift}
-switch productBarcode {
-case .upc(let numberSystem, let manufacturer, let product, let check):
-	print("UPC: \(numberSystem), \(manufacturer), \(product), \(check).")
-case .qrCode(let productCode):
-	print("QR code: \(productCode).")
-}
-// Prints "QR code: ABCDEFGHIJKLMNOP."
-\end{swift}
-If all of the associated values for an enumeration case are extracted as constants, or if all are extracted as variables, you can place a single let or var annotation before the case name, for brevity:
-\begin{swift}
-switch productBarcode {
-case let .upc(numberSystem, manufacturer, product, check):
-	print("UPC : \(numberSystem), \(manufacturer), \(product), \(check).")
-case let .qrCode(productCode):
-	print("QR code: \(productCode).")
-}
-// Prints "QR code: ABCDEFGHIJKLMNOP."
-\end{swift}
-
-\paragraph{Raw Values}
-
-The barcode example in Associated Values shows how cases of an enumeration can declare that they store associated values of different types.
-As an alternative to associated values, enumeration cases can come prepopulated with default values (called raw values), which are all of the same type.
-
-Here's an example that stores raw ASCII values alongside named enumeration cases:
-\begin{swift}
-enum ASCIIControlCharacter: Character {
-	case tab = "\t"
-	case lineFeed = "\n"
-	case carriageReturn = "\r"
-}
-\end{swift}
-Here, the raw values for an enumeration called ASCIIControlCharacter are defined to be of type Character, and are set to some of the more common ASCII control characters.
-Character values are described in Strings and Characters.
-
-Raw values can be strings, characters, or any of the integer or floating-point number types.
-Each raw value must be unique within its enumeration declaration.
-
-Note
-
-Raw values are not the same as associated values.
-Raw values are set to prepopulated values when you first define the enumeration in your code, like the three ASCII codes above.
-The raw value for a particular enumeration case is always the same.
-Associated values are set when you create a new constant or variable based on one of the enumeration's cases, and can be different each time you do so.
-Implicitly Assigned Raw Values
-
-When you're working with enumerations that store integer or string raw values, you don't have to explicitly assign a raw value for each case.
-When you don't, Swift automatically assigns the values for you.
-
-For example, when integers are used for raw values, the implicit value for each case is one more than the previous case.
-If the first case doesn't have a value set, its value is 0.
-
-The enumeration below is a refinement of the earlier Planet enumeration, with integer raw values to represent each planet's order from the sun:
-
-\begin{swift}
-enum Planet: Int {
-	case mercury = 1, venus, earth, mars, jupiter, saturn, uranus, neptune
-}
-\end{swift}
-In the example above, Planet.mercury has an explicit raw value of 1, Planet.venus has an implicit raw value of 2, and so on.
-
-When strings are used for raw values, the implicit value for each case is the text of that case's name.
-
-The enumeration below is a refinement of the earlier CompassPoint enumeration, with string raw values to represent each direction's name:
-\begin{swift}
-enum CompassPoint: String {
-	case north, south, east, west
-}
-\end{swift}
-In the example above, CompassPoint.south has an implicit raw value of "south", and so on.
-
-You access the raw value of an enumeration case with its rawValue property:
-\begin{swift}
-let earthsOrder = Planet.earth.rawValue
-// earthsOrder is 3
-
-let sunsetDirection = CompassPoint.west.rawValue
-// sunsetDirection is "west"
-\end{swift}
-
-\paragraph{Initializing from a Raw Value}
-
-If you define an enumeration with a raw-value type, the enumeration automatically receives an initializer that takes a value of the raw value's type (as a parameter called rawValue) and returns either an enumeration case or nil.
-You can use this initializer to try to create a new instance of the enumeration.
-
-This example identifies Uranus from its raw value of 7:
-\begin{swift}
-let possiblePlanet = Planet(rawValue: 7)
-// possiblePlanet is of type Planet? and equals Planet.uranus
-\end{swift}
-Not all possible Int values will find a matching planet, however.
-Because of this, the raw value initializer always returns an optional enumeration case.
-In the example above, possiblePlanet is of type Planet?, or "optional Planet."
-Note
-
-The raw value initializer is a failable initializer, because not every raw value will return an enumeration case.
-For more information, see Failable Initializers.
-
-If you try to find a planet with a position of 11, the optional Planet value returned by the raw value initializer will be nil:
-\begin{swift}
-let positionToFind = 11
-if let somePlanet = Planet(rawValue: positionToFind) {
-	switch somePlanet {
-	case .earth:
-		print("Mostly harmless")
-	default:
-		print("Not a safe place for humans")
-	}
-} else {
-	print("There isn't a planet at position \(positionToFind)")
-}
-// Prints "There isn't a planet at position 11"
-\end{swift}
-This example uses optional binding to try to access a planet with a raw value of 11.
-The statement if let somePlanet = Planet(rawValue: 11) creates an optional Planet, and sets somePlanet to the value of that optional Planet if it can be retrieved.
-In this case, it isn't possible to retrieve a planet with a position of 11, and so the else branch is executed instead.
-
-\paragraph{Recursive Enumerations}
-
-A recursive enumeration is an enumeration that has another instance of the enumeration as the associated value for one or more of the enumeration cases.
-You indicate that an enumeration case is recursive by writing indirect before it, which tells the compiler to insert the necessary layer of indirection.
-
-For example, here is an enumeration that stores simple arithmetic expressions:
-\begin{swift}
-enum ArithmeticExpression {
-	case number(Int)
-	indirect case addition(ArithmeticExpression, ArithmeticExpression)
-	indirect case multiplication(ArithmeticExpression, ArithmeticExpression)
-}
-\end{swift}
-You can also write indirect before the beginning of the enumeration to enable indirection for all of the enumeration's cases that have an associated value:
-\begin{swift}
-indirect enum ArithmeticExpression {
-	case number(Int)
-	case addition(ArithmeticExpression, ArithmeticExpression)
-	case multiplication(ArithmeticExpression, ArithmeticExpression)
-}
-\end{swift}
-This enumeration can store three kinds of arithmetic expressions: a plain number, the addition of two expressions, and the multiplication of two expressions.
-The addition and multiplication cases have associated values that are also arithmetic expressions -- these associated values make it possible to nest expressions.
-For example, the expression (5 + 4) * 2 has a number on the right-hand side of the multiplication and another expression on the left-hand side of the multiplication.
-Because the data is nested, the enumeration used to store the data also needs to support nesting -- this means the enumeration needs to be recursive.
-The code below shows the ArithmeticExpression recursive enumeration being created for (5 + 4) * 2:
-\begin{swift}
-let five = ArithmeticExpression.number(5)
-let four = ArithmeticExpression.number(4)
-let sum = ArithmeticExpression.addition(five, four)
-let product = ArithmeticExpression.multiplication(sum, ArithmeticExpression.number(2))
-\end{swift}
-A recursive function is a straightforward way to work with data that has a recursive structure.
-For example, here's a function that evaluates an arithmetic expression:
-\begin{swift}
-func evaluate(_ expression: ArithmeticExpression) -> Int {
-	switch expression {
-	case let .number(value):
-		return value
-	case let .addition(left, right):
-		return evaluate(left) + evaluate(right)
-	case let .multiplication(left, right):
-		return evaluate(left) * evaluate(right)
-	}
-}
-
-print(evaluate(product))
-// Prints "18"
-\end{swift}
-This function evaluates a plain number by simply returning the associated value.
-It evaluates an addition or multiplication by evaluating the expression on the left-hand side, evaluating the expression on the right-hand side, and then adding them or multiplying them.
+Conversion from @rawValue@ to enumerator may fail (bad lookup), so the result is an optional value.
 
 
@@ -1068,1161 +891,204 @@
 % https://docs.python.org/3/howto/enum.html
 
-Python is a dynamically-typed reflexive programming language with multiple versions, and hence, it is possible to extend existing or build new language features within the language.
+Python is a dynamically-typed reflexive programming language with multiple incompatible versions.
+The generality of the language makes it is possible to extend existing or build new language features.
 As a result, discussing Python enumerations is a moving target, because if a features does not exist, it can often be created with varying levels of complexity within the language.
-Nevertheless, the following is a discuss of the core enumeration features that come with Python 3.13.
-
-A Python enumeration type is a set of ordered scoped identifiers (enumerators) bound to \emph{unique} values.
-An enumeration is not a basic type;
-it is a @class@ inheriting from the @Enum@ class, where the enumerators must be explicitly initialized, \eg:
-\begin{python}
-class Week(@Enum@): Mon = 1; Tue = 2; Wed = 3; Thu = 4; Fri = 5; Sat = 6; Sun = 7
+Therefore, the following discussion is (mostly) restricted to the core enumeration features in Python 3.13.
+
+A Python enumeration is not a basic type;
+it is a @class@ inheriting from the @Enum@ class.
+The @Enum@ class presents a set of scoped enumerators, where each enumerator is a pair object with a \emph{constant} string name and arbitrary value.
+Hence, an enumeration instance is a fixed type (enumeration pair), and its value is the type of one of the enumerator pairs.
+
+The enumerator value fields must be explicitly initialized and be \emph{unique}.
+\begin{python}
+class Week(!Enum!): Mon = 1; Tue = 2; Wed = 3; Thu = 4; Fri = 5; Sat = 6; Sun = 7
 \end{python}
 and/or explicitly auto initialized, \eg:
 \begin{python}
-class Week(Enum): Mon = 1; Tue = 2; Wed = 3; Thu = 10; Fri = @auto()@; Sat = 4; Sun = @auto()@
-\end{python}
-where @auto@ increments by 1 from the previous enumerator value \see{Golang \lstinline[language=Go]{iota}, \VRef{s:Golang}}.
-Object initialization and assignment are restricted to the enumerators of this type.
-An enumerator initialized with same value is an alias and invisible at the enumeration level, \ie the alias it substituted for its aliasee.
-\begin{python}
-class Week(Enum): Mon = 1; Tue = 2; Wed = 3; Thu = 10; Fri = @10@; Sat = @10@; Sun = @10@
+class Week(Enum): Mon = 1; Tue = 2; Wed = 3; Thu = 10; Fri = !auto()!; Sat = 4; Sun = !auto()!
+Mon : 1 Tue : 2 Wed : 3 Thu : 10 Fri : !11! Sat : 4 Sun : !12!
+\end{python}
+where @auto@ increments by 1 from the previous @auto@ value \see{Golang \lstinline[language=Go]{iota}, \VRef{s:Golang}}.
+@auto@ is controlled by member @_generate_next_value_()@, which can be overridden:
+\begin{python}
+@staticmethod
+def _generate_next_value_( name, start, count, last_values ):
+	return name
+\end{python}
+
+There is no direct concept of restricting the enumerators in an enumeration \emph{instance} because the dynamic typing changes the type.
+\begin{python}
+class RGB(Enum): Red = 1; Green = 2; Blue = 3
+day : Week = Week.Tue;		$\C{\# type is Week}$
+!day = RGB.Red!				$\C{\# type is RGB}$
+!day : Week = RGB.Red!		$\C{\# type is RGB}$
+\end{python}
+The enumerators are constants and cannot be reassigned.
+Hence, while enumerators can be different types,
+\begin{python}
+class Diff(Enum): Int = 1; Float = 3.5; Str = "ABC"
+\end{python}
+it is not an ADT because the enumerator names are not constructors.
+
+An enumerator initialized with the same value is an alias and invisible at the enumeration level, \ie the alias is substituted for its aliasee.
+\begin{python}
+class WeekD(Enum): Mon = 1; Tue = 2; Wed = 3; Thu = !10!; Fri = !10!; Sat = !10!; Sun = !10!
 \end{python}
 Here, the enumeration has only 4 enumerators and 3 aliases.
 An alias is only visible by dropping down to the @class@ level and asking for class members.
-@Enum@ only supports equality comparison between enumerator values;
-the extended class @OrderedEnum@ adds relational operators @<@, @<=@, @>@, and @>=@.
-
-There are bidirectional enumeration pseudo-functions for label and value, but there is no concept of access using ordering (position).
+Aliasing is prevented using the @unique@ decorator.
+\begin{python}
+!@unique!
+class DupVal(Enum): One = 1; Two = 2; Three = !3!; Four = !3!
+ValueError: duplicate values found in <enum 'DupVal'>: Four -> Three
+\end{python}
+
+\begin{lrbox}{\myboxA}
+\begin{python}
+def by_position(enum_type, position):
+	for index, value in enumerate(enum_type):
+		if position == index: return value
+	raise Exception("by_position out of range")
+\end{python}
+\end{lrbox}
+There are bidirectional enumeration pseudo-functions for label and value, but there is no concept of access using ordering (position).\footnote{
+There is an $O(N)$ mechanism to access an enumerator's value by position. \newline \usebox\myboxA}
 \begin{cquote}
 \setlength{\tabcolsep}{15pt}
 \begin{tabular}{@{}ll@{}}
 \begin{python}
-Week.Thu.value == 10;
-Week.Thu.name == 'Thu';
-\end{python}
-&
-\begin{python}
-Week( 10 ) == Thu
-Week['Thu'].value = 10
-\end{python}
-\end{tabular}
-\end{cquote}
+Week.Thu.value == 4;
+Week.Thu.name == "Thu";
+\end{python}
+&
+\begin{python}
+Week( 4 ) == Week.Thu
+Week["Thu"].value == 4
+\end{python}
+\end{tabular}
+\end{cquote}
+@Enum@ only supports equality comparison between enumerator values.
+There are multiple library extensions to @Enum@, \eg @OrderedEnum@ recipe class, adding relational operators @<@, @<=@, @>@, and @>=@.
 
 An enumeration \lstinline[language=python]{class} can have methods.
 \begin{python}
-class Week(Enum):
+class Week(!OrderedEnum!):
 	Mon = 1; Tue = 2; Wed = 3; Thu = 4; Fri = 5; Sat = 6; Sun = 7
-	$\\@$classmethod
-	def today(cls, date):
-		return cls(date.isoweekday())
-print( "today:", Week.today(date.today()))
-today: Week.Mon
-\end{python}
-The method @today@ retrieves the day of the week and uses it as an index to print out the corresponding label of @Week@.
-
-@Flag@ allows combining several members into a single variable:
-\begin{python}
-print( repr(WeekF.Sat | WeekF.Sun) )
-<WeekF.Sun|Sat: 96>
-\end{python}
-You can even iterate over a @Flag@ variable:
-\begin{python}
+	def !isWeekday(self)!:		# method
+		return Week(self.value) !<=! Week.Fri
+	def !isWeekend(self)!:		# method
+		return Week.Sat !<=! Week(self.value) 
+\end{python}
+
+An enumeration can be used in the @if@ and @switch@ statements but only for equality tests, unless extended to @OrderedEnum@.
+\begin{cquote}
+\setlength{\tabcolsep}{12pt}
+\begin{tabular}{@{}ll@{}}
+\begin{python}
+if day <= Week.Fri :
+	print( "weekday" );
+
+
+
+\end{python}
+&
+\begin{python}
+match day:
+	case Week.Mon | Week.Tue | Week.Wed | Week.Thu | Week.Fri:
+		print( "weekday" );
+	case Week.Sat | Week.Sun:
+		print( "weekend" );
+\end{python}
+\end{tabular}
+\end{cquote}
+Looping is performed using the enumeration type or @islice@ from @itertools@ based on position.
+\begin{python}
+for day in !Week!:					$\C[2.25in]{\# Mon : 1 Tue : 2 Wed : 3 Thu : 4 Fri : 5 Sat : 6 Sun : 7}$
+	print( day.name, ":", day.value, end=" " )
+for day in !islice(Week, 0, 5)!:	$\C{\# Mon : 1 Tue : 2 Wed : 3 Thu : 4 Fri : 5}$
+	print( day.name, ":", day.value, end=" " )
+for day in !islice(Week, 5, 7)!:	$\C{\# Sat : 6 Sun : 7}$
+	print( day.name, ":", day.value, end=" " )
+for day in !islice(Week,0, 7, 2)!:	$\C{\# Mon : 1 Wed : 3 Fri : 5 Sun : 7}\CRT$
+	print( day.name, ":", day.value, end=" " )
+\end{python}
+Iterating that includes alias names only (strings) is done using attribute @__members__@.
+\begin{python}
+for day in WeekD.__members__:
+	print( day, ":", end=" " )
+Mon : Tue : Wed : Thu : Fri : Sat : Sun 
+\end{python}
+
+Enumeration subclassing is allowed only if the enumeration base-class does not define any members.
+\begin{python}
+class WeekE(OrderedEnum): !pass!;  # no members
+class WeekDay(WeekE): Mon = 1; Tue = 2; Wed = 3; Thu = 4; Fri = 5;
+class WeekEnd(WeekE): Sat = 6; Sun = 7
+\end{python}
+Here, type @WeekE@ is an abstract type because the dynamic typing never uses it.
+\begin{cquote}
+\setlength{\tabcolsep}{25pt}
+\begin{tabular}{@{}ll@{}}
+\begin{python}
+print( type(WeekE) )
+day : WeekE = WeekDay.Fri	# set type
+print( type(day), day )
+day = WeekEnd.Sat			    # set type
+print( type(day), day )
+\end{python}
+&
+\begin{python}
+<$class$ 'enum.EnumType'>
+
+<enum 'WeekDay'> WeekDay.Fri
+
+<enum 'WeekEnd'> WeekEnd.Sat
+\end{python}
+\end{tabular}
+\end{cquote}
+
+There are a number of supplied enumeration base-types: @IntEnum@, @StrEnum@, @IntFalg@, @Flag@, which restrict the values in an enum using multi-inheritance.
+@IntEnum@ is a subclass of @int@ and @Enum@, allowing enumerator comparison to @int@ and other enumerators of this type (like C enumerators).
+@StrEnum@ is the same as @IntEnum@ but a subclass of the string type \lstinline[language=python]{str}.
+@IntFlag@, is a restricted subclass of @int@ where the enumerators can be combined using the bitwise operators (@&@, @|@, @^@, @~@) and the result is an @IntFlag@ member.
+@Flag@ is the same as @IntFlag@ but cannot be combined with, nor compared against, any other @Flag@ enumeration, nor @int@.
+Auto increment for @IntFlag@ and @Flag@ is by powers of 2.
+Enumerators that are a combinations of single bit enumerators are aliases, and hence, invisible.
+The following is an example for @Flag@.
+\begin{python}
+class WeekF(Flag): Mon = 1; Tue = 2; Wed = 4; Thu = !auto()!; Fri = 16; Sat = 32; Sun = 64; \
+	  Weekday = Mon | Tue | Wed | Thu | Fri; \
+	  Weekend = Sat | Sun
+print( f"0x{repr(WeekF.Weekday.value)} 0x{repr(WeekF.Weekend.value)}" )
+0x31 0x96
+\end{python}
+It is possible to enumerate through a @Flag@ enumerator (no aliases):
+\begin{python}
+for day in WeekF:
+	print( f"{day.name}: {day.value}", end=" ")
+Mon: 1 Tue: 2 Wed: 4 Thu: 8 Fri: 16 Sat: 32 Sun: 64 
+\end{python}
+and a combined alias enumerator for @Flag@.
+\begin{cquote}
+\setlength{\tabcolsep}{15pt}
+\begin{tabular}{@{}ll@{}}
+\begin{python}
+weekday = WeekF.Weekday
+for day in weekday:
+	print( f"{day.name}:"
+		   f" {day.value}", end=" " )
+Mon: 1 Tue: 2 Wed: 4 Thu: 8 Fri: 16 
+\end{python}
+&
+\begin{python}
+weekend = WeekF.Weekend
 for day in weekend:
-	print(day)
-WeekF.Sat
-WeekF.Sun
-\end{python}
-Okay, let's get some chores set up:
-\begin{python}
->>> chores_for_ethan = {
-...    'feed the cat': Week.MONDAY | Week.WEDNESDAY | Week.FRIDAY,
-...    'do the dishes': Week.TUESDAY | Week.THURSDAY,
-...    'answer SO questions': Week.SATURDAY,
-...    }
-\end{python}
-And a function to display the chores for a given day:
-\begin{python}
->>> def show_chores(chores, day):
-...    for chore, days in chores.items():
-...        if day in days:
-...            print(chore)
->>> show_chores(chores_for_ethan, Week.SATURDAY)
-answer SO questions
-\end{python}
-Auto incrmenet for @Flag@ is by powers of 2.
-\begin{python}
-class WeekF(Flag): Mon = auto(); Tue = auto(); Wed = auto(); Thu = auto(); Fri = auto();  \
-							Sat = auto(); Sun = auto(); Weekend = Sat | Sun
-for d in WeekF:
-	print( f"{d.name}: {d.value}", end=" ")
-Mon: 1 Tue: 2 Wed: 4 Thu: 8 Fri: 16 Sat: 32 Sun: 64 WeekA.Weekend
-\end{python}
-
-\subsection{Programmatic access to enumeration members and their attributes}
-
-Sometimes it's useful to access members in enumerations programmatically (i.e. situations where @Color.RED@ won't do because the exact color is not known at program-writing time).
-@Enum@ allows such access:
-\begin{python}
-print(RGB(1), RGB(3), )
-RGB.RED RGB.GREEN
-\end{python}
-If you want to access enum members by name, use item access:
-\begin{python}
-print( RGBa['RED'], RGBa['GREEN'] )
-RGB.RED RGB.GREEN
-\end{python}
-If you have an enum member and need its name or value:
-\begin{python}
-member = RGBa.RED
-print( f"{member.name} {member.value}" )
-RED 1
-\end{python}
-
-
-\subsection{Ensuring unique enumeration values}
-
-By default, enumerations allow multiple names as aliases for the same value.
-When this behavior isn't desired, you can use the @unique()@ decorator:
-\begin{python}
-from enum import Enum, unique
-$@$unique
-class DupVal(Enum): ONE = 1; TWO = 2; THREE = 3; FOUR = 3
-ValueError: duplicate values found in <enum 'Mistake'>: FOUR -> THREE
-\end{python}
-
-\subsection{Using automatic values}
-
-If the exact value is unimportant you can use @auto@:
-\begin{python}
-from enum import Enum, auto
-class RGBa(Enum): RED = auto(); BLUE = auto(); GREEN = auto()
-\end{python}
-(Like Golang @iota@.)
-The values are chosen by @_generate_next_value_()@, which can be overridden:
-\begin{python}
->>> class AutoName(Enum):
-...     $@$staticmethod
-...     def _generate_next_value_(name, start, count, last_values):
-...         return name
-... 
->>> class Ordinal(AutoName):
-...     NORTH = auto()
-...     SOUTH = auto()
-...     EAST = auto()
-...     WEST = auto()
-... 
->>> [member.value for member in Ordinal]
-['NORTH', 'SOUTH', 'EAST', 'WEST']
-\end{python}
-Note The @_generate_next_value_()@ method must be defined before any members.
-
-\subsection{Iteration}
-
-Iterating over the members of an enum does not provide the aliases:
-\begin{python}
->>> list(Shape)
-[<Shape.SQUARE: 2>, <Shape.DIAMOND: 1>, <Shape.CIRCLE: 3>]
->>> list(Week)
-[<Week.MONDAY: 1>, <Week.TUESDAY: 2>, <Week.WEDNESDAY: 4>, <Week.THURSDAY: 8>,
-<Week.FRIDAY: 16>, <Week.SATURDAY: 32>, <Week.SUNDAY: 64>]
-\end{python}
-Note that the aliases @Shape.ALIAS_FOR_SQUARE@ and @Week.WEEKEND@ aren't shown.
-
-The special attribute @__members__@ is a read-only ordered mapping of names to members.
-It includes all names defined in the enumeration, including the aliases:
-\begin{python}
->>> for name, member in Shape.__members__.items():
-...     name, member
-... 
-('SQUARE', <Shape.SQUARE: 2>)
-('DIAMOND', <Shape.DIAMOND: 1>)
-('CIRCLE', <Shape.CIRCLE: 3>)
-('ALIAS_FOR_SQUARE', <Shape.SQUARE: 2>)
-\end{python}
-The @__members__@ attribute can be used for detailed programmatic access to the enumeration members.
-For example, finding all the aliases:
-\begin{python}
->>> [name for name, member in Shape.__members__.items() if member.name != name]
-['ALIAS_FOR_SQUARE']
-\end{python}
-Note: Aliases for flags include values with multiple flags set, such as 3, and no flags set, i.e. 0.
-
-\subsection{Comparisons}
-
-Enumeration members are compared by identity:
-\begin{python}
->>> Color.RED is Color.RED
-True
->>> Color.RED is Color.BLUE
-False
->>> Color.RED is not Color.BLUE
-True
-\end{python}
-Ordered comparisons between enumeration values are not supported.
-Enum members are not integers (but see @IntEnum@ below):
-\begin{python}
->>> Color.RED < Color.BLUE
-Traceback (most recent call last):
-  File "<stdin>", line 1, in <module>
-TypeError: '<' not supported between instances of 'Color' and 'Color'
-\end{python}
-Equality comparisons are defined though:
-\begin{python}
->>> Color.BLUE == Color.RED
-False
->>> Color.BLUE != Color.RED
-True
->>> Color.BLUE == Color.BLUE
-True
-\end{python}
-Comparisons against non-enumeration values will always compare not equal (again, @IntEnum@ was explicitly designed to behave differently, see below):
-\begin{python}
->>> Color.BLUE == 2
-False
-\end{python}
-
-Warning: It is possible to reload modules -- if a reloaded module contains enums, they will be recreated, and the new members may not compare identical/equal to the original members.
-
-\subsection{Allowed members and attributes of enumerations}
-
-Most of the examples above use integers for enumeration values.
-Using integers is short and handy (and provided by default by the Functional API), but not strictly enforced.
-In the vast majority of use-cases, one doesn't care what the actual value of an enumeration is.
-But if the value is important, enumerations can have arbitrary values.
-
-Enumerations are Python classes, and can have methods and special methods as usual. If we have this enumeration:
-\begin{python}
->>> class Mood(Enum):
-...     FUNKY = 1
-...     HAPPY = 3
-... 
-...     def describe(self):
-...         # self is the member here
-...         return self.name, self.value
-... 
-...     def __str__(self):
-...         return 'my custom str! {0}'.format(self.value)
-... 
-...     $@$classmethod
-... 
-...     def favorite_mood(cls):
-...         # cls here is the enumeration
-...         return cls.HAPPY
-...
-\end{python}
-Then:
-\begin{python}
->>> Mood.favorite_mood()
-<Mood.HAPPY: 3>
->>> Mood.HAPPY.describe()
-('HAPPY', 3)
->>> str(Mood.FUNKY)
-'my custom str! 1'
-\end{python}
-The rules for what is allowed are as follows: names that start and end with a single underscore are reserved by enum and cannot be used;
-all other attributes defined within an enumeration will become members of this enumeration, with the exception of special methods (@__str__()@, @__add__()@, etc.), descriptors (methods are also descriptors), and variable names listed in @_ignore_@.
-
-Note: if your enumeration defines @__new__()@ and/or @__init__()@, any value(s) given to the enum member will be passed into those methods.
-See Planet for an example.
-
-Note: The @__new__()@ method, if defined, is used during creation of the Enum members;
-it is then replaced by Enum's @__new__()@ which is used after class creation for lookup of existing members.
-See When to use @__new__()@ vs. @__init__()@ for more details.
-
-\subsection{Restricted Enum subclassing}
-
-A new @Enum@ class must have one base enum class, up to one concrete data type, and as many object-based mixin classes as needed.
-The order of these base classes is:
-\begin{python}
-class EnumName([mix-in, ...,] [data-type,] base-enum):
-	pass
-\end{python}
-Also, subclassing an enumeration is allowed only if the enumeration does not define any members.
-So this is forbidden:
-\begin{python}
->>> class MoreColor(Color):
-...     PINK = 17
-... 
-Traceback (most recent call last):
-...
-TypeError: <enum 'MoreColor'> cannot extend <enum 'Color'>
-\end{python}
-But this is allowed:
-\begin{python}
->>> class Foo(Enum):
-...     def some_behavior(self):
-...         pass
-... 
->>> class Bar(Foo):
-...     HAPPY = 1
-...     SAD = 2
-... 
-\end{python}
-Allowing subclassing of enums that define members would lead to a violation of some important invariants of types and instances.
-On the other hand, it makes sense to allow sharing some common behavior between a group of enumerations. (See OrderedEnum for an example.)
-
-\subsection{Dataclass support}
-
-When inheriting from a @dataclass@, the @__repr__()@ omits the inherited class' name.
-For example:
-\begin{python}
->>> from dataclasses import dataclass, field
->>> $@$dataclass
-... class CreatureDataMixin:
-...     size: str
-...     legs: int
-...     tail: bool = field(repr=False, default=True)
-... 
->>> class Creature(CreatureDataMixin, Enum):
-...     BEETLE = 'small', 6
-...     DOG = 'medium', 4
-... 
->>> Creature.DOG
-<Creature.DOG: size='medium', legs=4>
-\end{python}
-Use the @dataclass()@ argument repr=False to use the standard @repr()@.
-
-Changed in version 3.12: Only the dataclass fields are shown in the value area, not the dataclass' name.
-
-\subsection{Pickling}
-
-Enumerations can be pickled and unpickled:
-\begin{python}
->>> from test.test_enum import Fruit
->>> from pickle import dumps, loads
->>> Fruit.TOMATO is loads(dumps(Fruit.TOMATO))
-True
-\end{python}
-The usual restrictions for pickling apply: picklable enums must be defined in the top level of a module, since unpickling requires them to be importable from that module.
-
-Note: With pickle protocol version 4 it is possible to easily pickle enums nested in other classes.
-
-It is possible to modify how enum members are pickled/unpickled by defining @__reduce_ex__()@ in the enumeration class.
-The default method is by-value, but enums with complicated values may want to use by-name:
-\begin{python}
->>> import enum
->>> class MyEnum(enum.Enum):
-...     __reduce_ex__ = enum.pickle_by_enum_name
-\end{python}
-Note: Using by-name for flags is not recommended, as unnamed aliases will not unpickle.
-
-\subsection{Functional API}
-
-The @Enum@ class is callable, providing the following functional API:
-\begin{python}
->>> Animal = Enum('Animal', 'ANT BEE CAT DOG')
->>> Animal
-<enum 'Animal'>
->>> Animal.ANT
-<Animal.ANT: 1>
->>> list(Animal)
-[<Animal.ANT: 1>, <Animal.BEE: 2>, <Animal.CAT: 3>, <Animal.DOG: 4>]
-\end{python}
-The semantics of this API resemble @namedtuple@.
-The first argument of the call to @Enum@ is the name of the enumeration.
-
-The second argument is the source of enumeration member names.
-It can be a whitespace-separated string of names, a sequence of names, a sequence of 2-tuples with key/value pairs, or a mapping (e.g. dictionary) of names to values.
-The last two options enable assigning arbitrary values to enumerations;
-the others auto-assign increasing integers starting with 1 (use the @start@ parameter to specify a different starting value).
-A new class derived from @Enum@ is returned.
-In other words, the above assignment to Animal is equivalent to:
-\begin{python}
->>> class Animal(Enum):
-...     ANT = 1
-...     BEE = 2
-...     CAT = 3
-...     DOG = 4
-... 
-\end{python}
-The reason for defaulting to 1 as the starting number and not 0 is that 0 is @False@ in a boolean sense, but by default enum members all evaluate to @True@.
-
-Pickling enums created with the functional API can be tricky as frame stack implementation details are used to try and figure out which module the enumeration is being created in (e.g. it will fail if you use a utility function in a separate module, and also may not work on IronPython or Jython).
-The solution is to specify the module name explicitly as follows:
-\begin{python}
->>> Animal = Enum('Animal', 'ANT BEE CAT DOG', module=__name__)
-\end{python}
-Warning: If module is not supplied, and @Enum@ cannot determine what it is, the new @Enum@ members will not be unpicklable; to keep errors closer to the source, pickling will be disabled.
-
-The new pickle protocol 4 also, in some circumstances, relies on @__qualname__@ being set to the location where pickle will be able to find the class.
-For example, if the class was made available in class SomeData in the global scope:
-\begin{python}
->>> Animal = Enum('Animal', 'ANT BEE CAT DOG', qualname='SomeData.Animal')
-\end{python}
-The complete signature is:
-\begin{python}
-Enum(
-	value='NewEnumName',
-	names=<...>,
-	*,
-	module='...',
-	qualname='...',
-	type=<mixed-in class>,
-	start=1,
-	)
-\end{python}
-\begin{itemize}
-\item
-@value@: What the new enum class will record as its name.
-\item
-@names@: The enum members.
-This can be a whitespace- or comma-separated string (values will start at 1 unless otherwise specified):
-\begin{python}
-'RED GREEN BLUE' | 'RED,GREEN,BLUE' | 'RED, GREEN, BLUE'
-\end{python}
-or an iterator of names:
-\begin{python}
-['RED', 'GREEN', 'BLUE']
-\end{python}
-or an iterator of (name, value) pairs:
-\begin{python}
-[('CYAN', 4), ('MAGENTA', 5), ('YELLOW', 6)]
-\end{python}
-or a mapping:
-\begin{python}
-{'CHARTREUSE': 7, 'SEA_GREEN': 11, 'ROSEMARY': 42}
-\end{python}
-\item
-module: name of module where new enum class can be found.
-\item
-@qualname@: where in module new enum class can be found.
-\item
-@type@: type to mix in to new enum class.
-\item
-@start@: number to start counting at if only names are passed in.
-\end{itemize}
-Changed in version 3.5: The start parameter was added.
-
-\subsection{Derived Enumerations}
-
-\subsection{IntEnum}
-
-The first variation of @Enum@ that is provided is also a subclass of @int@.
-Members of an @IntEnum@ can be compared to integers;
-by extension, integer enumerations of different types can also be compared to each other:
-\begin{python}
->>> from enum import IntEnum
->>> class Shape(IntEnum):
-...     CIRCLE = 1
-...     SQUARE = 2
-... 
->>> class Request(IntEnum):
-...     POST = 1
-...     GET = 2
-... 
->>> Shape == 1
-False
->>> Shape.CIRCLE == 1
-True
->>> Shape.CIRCLE == Request.POST
-True
-\end{python}
-However, they still can't be compared to standard @Enum@ enumerations:
-\begin{python}
->>> class Shape(IntEnum):
-...     CIRCLE = 1
-...     SQUARE = 2
-... 
->>> class Color(Enum):
-...     RED = 1
-...     GREEN = 2
-... 
->>> Shape.CIRCLE == Color.RED
-False
-\end{python}
-@IntEnum@ values behave like integers in other ways you'd expect:
-\begin{python}
->>> int(Shape.CIRCLE)
-1
->>> ['a', 'b', 'c'][Shape.CIRCLE]
-'b'
->>> [i for i in range(Shape.SQUARE)]
-[0, 1]
-\end{python}
-
-\subsection{StrEnum}
-
-The second variation of @Enum@ that is provided is also a subclass of @str@.
-Members of a @StrEnum@ can be compared to strings;
-by extension, string enumerations of different types can also be compared to each other.
-
-New in version 3.11.
-
-\subsection{IntFlag}
-
-The next variation of @Enum@ provided, @IntFlag@, is also based on @int@.
-The difference being @IntFlag@ members can be combined using the bitwise operators (@&, |, ^, ~@) and the result is still an @IntFlag@ member, if possible.
-Like @IntEnum@, @IntFlag@ members are also integers and can be used wherever an int is used.
-
-Note: Any operation on an IntFlag member besides the bit-wise operations will lose the @IntFlag@ membership.
-
-Bit-wise operations that result in invalid @IntFlag@ values will lose the @IntFlag@ membership.
-See @FlagBoundary@ for details.
-
-New in version 3.6.
-
-Changed in version 3.11.
-
-Sample @IntFlag@ class:
-\begin{python}
->>> from enum import IntFlag
->>> class Perm(IntFlag):
-...     R = 4
-...     W = 2
-...     X = 1
-... 
->>> Perm.R | Perm.W
-<Perm.R|W: 6>
->>> Perm.R + Perm.W
-6
->>> RW = Perm.R | Perm.W
->>> Perm.R in RW
-True
-\end{python}
-It is also possible to name the combinations:
-\begin{python}
->>> class Perm(IntFlag):
-...     R = 4
-...     W = 2
-...     X = 1
-...     RWX = 7
-... 
->>> Perm.RWX
-<Perm.RWX: 7>
->>> ~Perm.RWX
-<Perm: 0>
->>> Perm(7)
-<Perm.RWX: 7>
-\end{python}
-Note: Named combinations are considered aliases. Aliases do not show up during iteration, but can be returned from by-value lookups.
-
-Changed in version 3.11.
-
-Another important difference between @IntFlag@ and @Enum@ is that if no flags are set (the value is 0), its boolean evaluation is @False@:
-\begin{python}
->>> Perm.R & Perm.X
-<Perm: 0>
->>> bool(Perm.R & Perm.X)
-False
-\end{python}
-Because @IntFlag@ members are also subclasses of int they can be combined with them (but may lose @IntFlag@ membership:
-\begin{python}
->>> Perm.X | 4
-<Perm.R|X: 5>
-
->>> Perm.X + 8
-9
-\end{python}
-Note: The negation operator, @~@, always returns an @IntFlag@ member with a positive value:
-\begin{python}
->>> (~Perm.X).value == (Perm.R|Perm.W).value == 6
-True
-\end{python}
-@IntFlag@ members can also be iterated over:
-\begin{python}
->>> list(RW)
-[<Perm.R: 4>, <Perm.W: 2>]
-\end{python}
-New in version 3.11.
-
-\subsection{Flag}
-
-The last variation is @Flag@.
-Like @IntFlag@, @Flag@ members can be combined using the bitwise operators (@&, |, ^, ~@).
-Unlike @IntFlag@, they cannot be combined with, nor compared against, any other @Flag@ enumeration, nor @int@.
-While it is possible to specify the values directly it is recommended to use @auto@ as the value and let @Flag@ select an appropriate value.
-
-New in version 3.6.
-
-Like @IntFlag@, if a combination of @Flag@ members results in no flags being set, the boolean evaluation is @False@:
-\begin{python}
->>> from enum import Flag, auto
->>> class Color(Flag):
-...     RED = auto()
-...     BLUE = auto()
-...     GREEN = auto()
-... 
->>> Color.RED & Color.GREEN
-<Color: 0>
->>> bool(Color.RED & Color.GREEN)
-False
-\end{python}
-Individual flags should have values that are powers of two (1, 2, 4, 8, ...), while combinations of flags will not:
-\begin{python}
->>> class Color(Flag):
-...     RED = auto()
-...     BLUE = auto()
-...     GREEN = auto()
-...     WHITE = RED | BLUE | GREEN
-... 
->>> Color.WHITE
-<Color.WHITE: 7>
-\end{python}
-Giving a name to the ``no flags set'' condition does not change its boolean value:
-\begin{python}
->>> class Color(Flag):
-...     BLACK = 0
-...     RED = auto()
-...     BLUE = auto()
-...     GREEN = auto()
-... 
->>> Color.BLACK
-<Color.BLACK: 0>
->>> bool(Color.BLACK)
-False
-\end{python}
-@Flag@ members can also be iterated over:
-\begin{python}
->>> purple = Color.RED | Color.BLUE
->>> list(purple)
-[<Color.RED: 1>, <Color.BLUE: 2>]
-\end{python}
-New in version 3.11.
-
-Note: For the majority of new code, @Enum@ and @Flag@ are strongly recommended, since @IntEnum@ and @IntFlag@ break some semantic promises of an enumeration (by being comparable to integers, and thus by transitivity to other unrelated enumerations).
-@IntEnum@ and @IntFlag@ should be used only in cases where @Enum@ and @Flag@ will not do;
-for example, when integer constants are replaced with enumerations, or for interoperability with other systems.
-
-\subsection{Others}
-
-While @IntEnum@ is part of the enum module, it would be very simple to implement independently:
-\begin{python}
-class IntEnum(int, Enum):
-	pass
-\end{python}
-This demonstrates how similar derived enumerations can be defined;
-for example a @FloatEnum@ that mixes in float instead of @int@.
-
-Some rules:
-\begin{itemize}
-\item
-When subclassing @Enum@, mix-in types must appear before @Enum@ itself in the sequence of bases, as in the @IntEnum@ example above.
-\item
-Mix-in types must be subclassable.
-For example, @bool@ and @range@ are not subclassable and will throw an error during Enum creation if used as the mix-in type.
-\item
-While @Enum@ can have members of any type, once you mix in an additional type, all the members must have values of that type, e.g. @int@ above.
-This restriction does not apply to mix-ins which only add methods and don't specify another type.
-\item
-When another data type is mixed in, the value attribute is not the same as the enum member itself, although it is equivalent and will compare equal.
-\item
-A data type is a mixin that defines @__new__()@, or a @dataclass@
-\item
-\%-style formatting: @%s@ and @%r@ call the @Enum@ class's @__str__()@ and @__repr__()@ respectively; other codes (such as @%i@ or @%h@ for @IntEnum@) treat the enum member as its mixed-in type.
-\item
-Formatted string literals, @str.format()@, and format() will use the enum's @__str__()@ method.
-\end{itemize}
-Note: Because @IntEnum@, @IntFlag@, and @StrEnum@ are designed to be drop-in replacements for existing constants, their @__str__()@ method has been reset to their data types' @__str__()@ method.
-
-\subsection{When to use \lstinline{__new__()} vs. \lstinline{__init__()}}
-
-@__new__()@ must be used whenever you want to customize the actual value of the @Enum@ member.
-Any other modifications may go in either @__new__()@ or @__init__()@, with @__init__()@ being preferred.
-
-For example, if you want to pass several items to the constructor, but only want one of them to be the value:
-\begin{python}
->>> class Coordinate(bytes, Enum):
-...     """
-...     Coordinate with binary codes that can be indexed by the int code.
-...     """
-...     def __new__(cls, value, label, unit):
-...         obj = bytes.__new__(cls, [value])
-...         obj._value_ = value
-...         obj.label = label
-...         obj.unit = unit
-...         return obj
-...     PX = (0, 'P.X', 'km')
-...     PY = (1, 'P.Y', 'km')
-...     VX = (2, 'V.X', 'km/s')
-...     VY = (3, 'V.Y', 'km/s')
-
->>> print(Coordinate['PY'])
-Coordinate.PY
-
->>> print(Coordinate(3))
-Coordinate.VY
-\end{python}
-Warning: Do not call @super().__new__()@, as the lookup-only @__new__@ is the one that is found; instead, use the data type directly.
-
-\subsection{Finer Points}
-
-Supported @__dunder__@ names
-
-@__members__@ is a read-only ordered mapping of member\_name:member items. It is only available on the class.
-
-@__new__()@, if specified, must create and return the enum members; it is also a very good idea to set the member's @_value_@ appropriately. Once all the members are created it is no longer used.
-Supported @_sunder_@ names
-\begin{itemize}
-\item
-@_name_@ -- name of the member
-\item
-@_value_@ -- value of the member; can be set / modified in @__new__@
-\item
-@_missing_@ -- a lookup function used when a value is not found; may be overridden
-\item
-@_ignore_@ -- a list of names, either as a @list@ or a @str@, that will not be transformed into members, and will be removed from the final class
-\item
-@_order_@ -- used in Python 2/3 code to ensure member order is consistent (class attribute, removed during class creation)
-\item
-@_generate_@next@_value_@ -- used by the Functional API and by @auto@ to get an appropriate value for an enum member; may be overridden
-\end{itemize}
-Note: For standard @Enum@ classes the next value chosen is the last value seen incremented by one.
-
-For @Flag@ classes the next value chosen will be the next highest power-of-two, regardless of the last value seen.
-
-New in version 3.6: @_missing_@, @_order_@, @_generate_@next@_value_@
-
-New in version 3.7: @_ignore_@
-
-To help keep Python 2 / Python 3 code in sync an @_order_@ attribute can be provided.
-It will be checked against the actual order of the enumeration and raise an error if the two do not match:
-\begin{python}
->>> class Color(Enum):
-...     _order_ = 'RED GREEN BLUE'
-...     RED = 1
-...     BLUE = 3
-...     GREEN = 2
-... 
-Traceback (most recent call last):
-...
-TypeError: member order does not match _order_:
-  ['RED', 'BLUE', 'GREEN']
-  ['RED', 'GREEN', 'BLUE']
-\end{python}
-Note: In Python 2 code the @_order_@ attribute is necessary as definition order is lost before it can be recorded.
-
-\subsection{\lstinline{_Private__names}}
-
-Private names are not converted to enum members, but remain normal attributes.
-
-Changed in version 3.11.
-
-\subsection{\lstinline{Enum} member type}
-
-@Enum@ members are instances of their enum class, and are normally accessed as @EnumClass.member@.
-In certain situations, such as writing custom enum behavior, being able to access one member directly from another is useful, and is supported;
-however, in order to avoid name clashes between member names and attributes/methods from mixed-in classes, upper-case names are strongly recommended.
-
-Changed in version 3.5.
-
-\subsection{Creating members that are mixed with other data types}
-
-When subclassing other data types, such as @int@ or @str@, with an @Enum@, all values after the = @are@ passed to that data type's constructor. For example:
-\begin{python}
->>> class MyEnum(IntEnum):      # help(int) -> int(x, base=10) -> integer
-...     example = '11', 16      # so x='11' and base=16
-... 
-MyEnum.example.value        # and hex(11) is...
-17
-\end{python}
-
-\subsection{\lstinline{Boolean} value of \lstinline{Enum} classes and members}
-
-Enum classes that are mixed with non-@Enum@ types (such as @int@, @str@, etc.) are evaluated according to the mixed-in type's rules;
-otherwise, all members evaluate as @True@.
-To make your own enum's boolean evaluation depend on the member's value add the following to your class:
-\begin{python}
-def __bool__(self):
-	return bool(self.value)
-\end{python}
-Plain @Enum@ classes always evaluate as @True@.
-
-\subsection{\lstinline{Enum} classes with methods}
-
-If you give your enum subclass extra methods, like the Planet class below, those methods will show up in a dir() of the member, but not of the class:
-\begin{python}
->>> dir(Planet)                         
-['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', 'VENUS',
- '__class__', '__doc__', '__members__', '__module__']
->>> dir(Planet.EARTH)                   
-['__class__', '__doc__', '__module__', 'mass', 'name', 'radius', 'surface_gravity', 'value']
-\end{python}
-
-\subsection{Combining members of \lstinline{Flag}}
-
-Iterating over a combination of @Flag@ members will only return the members that are comprised of a single bit:
-\begin{python}
->>> class Color(Flag):
-...     RED = auto()
-...     GREEN = auto()
-...     BLUE = auto()
-...     MAGENTA = RED | BLUE
-...     YELLOW = RED | GREEN
-...     CYAN = GREEN | BLUE
-... 
->>> Color(3)  # named combination
-<Color.YELLOW: 3>
->>> Color(7)      # not named combination
-<Color.RED|GREEN|BLUE: 7>
-\end{python}
-
-\subsection{\lstinline{Flag} and \lstinline{IntFlag} minutia}
-
-Using the following snippet for our examples:
-\begin{python}
->>> class Color(IntFlag):
-...     BLACK = 0
-...     RED = 1
-...     GREEN = 2
-...     BLUE = 4
-...     PURPLE = RED | BLUE
-...     WHITE = RED | GREEN | BLUE
-... 
-\end{python}
-the following are true:
-\begin{itemize}
-\item
-single-bit flags are canonical
-\item
-multi-bit and zero-bit flags are aliases
-\item
-only canonical flags are returned during iteration:
-\begin{python}
->>> list(Color.WHITE)
-[<Color.RED: 1>, <Color.GREEN: 2>, <Color.BLUE: 4>]
-\end{python}
-negating a flag or flag set returns a new flag/flag set with the corresponding positive integer value:
-\begin{python}
->>> Color.BLUE
-<Color.BLUE: 4>
-
->>> ~Color.BLUE
-<Color.RED|GREEN: 3>
-\end{python}
-\item
-names of pseudo-flags are constructed from their members' names:
-\begin{python}
->>> (Color.RED | Color.GREEN).name
-'RED|GREEN'
-\end{python}
-\item
-multi-bit flags, aka aliases, can be returned from operations:
-\begin{python}
->>> Color.RED | Color.BLUE
-<Color.PURPLE: 5>
-
->>> Color(7)  # or Color(-1)
-<Color.WHITE: 7>
-
->>> Color(0)
-<Color.BLACK: 0>
-\end{python}
-\item
-membership / containment checking: zero-valued flags are always considered to be contained:
-\begin{python}
->>> Color.BLACK in Color.WHITE
-True
-\end{python}
-otherwise, only if all bits of one flag are in the other flag will True be returned:
-\begin{python}
->>> Color.PURPLE in Color.WHITE
-True
-
->>> Color.GREEN in Color.PURPLE
-False
-\end{python}
-\end{itemize}
-There is a new boundary mechanism that controls how out-of-range / invalid bits are handled: @STRICT@, @CONFORM@, @EJECT@, and @KEEP@:
-\begin{itemize}
-\item
-@STRICT@ --> raises an exception when presented with invalid values
-\item
-@CONFORM@ --> discards any invalid bits
-\item
-@EJECT@ --> lose Flag status and become a normal int with the given value
-\item
-@KEEP@ --> keep the extra bits
-\begin{itemize}
-\item
-keeps Flag status and extra bits
-\item
-extra bits do not show up in iteration
-\item
-extra bits do show up in repr() and str()
-\end{itemize}
-\end{itemize}
-The default for @Flag@ is @STRICT@, the default for @IntFlag@ is @EJECT@, and the default for @_convert_@ is @KEEP@ (see @ssl.Options@ for an example of when @KEEP@ is needed).
-
-\section{How are Enums and Flags different?}
-
-Enums have a custom metaclass that affects many aspects of both derived @Enum@ classes and their instances (members).
-
-\subsection{Enum Classes}
-
-The @EnumType@ metaclass is responsible for providing the @__contains__()@, @__dir__()@, @__iter__()@ and other methods that allow one to do things with an @Enum@ class that fail on a typical class, such as @list(Color)@ or @some_enum_var@ in @Color@.
-@EnumType@ is responsible for ensuring that various other methods on the final @Enum@ class are correct (such as @__new__()@, @__getnewargs__()@, @__str__()@ and @__repr__()@).
-
-\subsection{Flag Classes}
-
-Flags have an expanded view of aliasing: to be canonical, the value of a flag needs to be a power-of-two value, and not a duplicate name.
-So, in addition to the @Enum@ definition of alias, a flag with no value (a.k.a. 0) or with more than one power-of-two value (e.g. 3) is considered an alias.
-
-\subsection{Enum Members (aka instances)}
-
-The most interesting thing about enum members is that they are singletons.
-@EnumType@ creates them all while it is creating the enum class itself, and then puts a custom @__new__()@ in place to ensure that no new ones are ever instantiated by returning only the existing member instances.
-
-\subsection{Flag Members}
-
-Flag members can be iterated over just like the @Flag@ class, and only the canonical members will be returned.
-For example:
-\begin{python}
->>> list(Color)
-[<Color.RED: 1>, <Color.GREEN: 2>, <Color.BLUE: 4>]
-\end{python}
-(Note that BLACK, PURPLE, and WHITE do not show up.)
-
-Inverting a flag member returns the corresponding positive value, rather than a negative value -- for example:
-\begin{python}
->>> ~Color.RED
-<Color.GREEN|BLUE: 6>
-\end{python}
-Flag members have a length corresponding to the number of power-of-two values they contain. For example:
-\begin{python}
->>> len(Color.PURPLE)
-2
-\end{python}
-
-\subsection{Enum Cookbook}
-
-While @Enum@, @IntEnum@, @StrEnum@, @Flag@, and @IntFlag@ are expected to cover the majority of use-cases, they cannot cover them all. Here are recipes for some different types of enumerations that can be used directly, or as examples for creating one's own.
-
-\subsection{Omitting values}
-
-In many use-cases, one doesn't care what the actual value of an enumeration is. There are several ways to define this type of simple enumeration:
-\begin{itemize}
-\item
-use instances of auto for the value
-\item
-use instances of object as the value
-\item
-use a descriptive string as the value
-\item
-use a tuple as the value and a custom @__new__()@ to replace the tuple with an @int@ value
-\end{itemize}
-Using any of these methods signifies to the user that these values are not important, and also enables one to add, remove, or reorder members without having to renumber the remaining members.
-
-\subsection{Using \lstinline{auto}}
-
-Using @auto@ would look like:
-\begin{python}
->>> class Color(Enum):
-...     RED = auto()
-...     BLUE = auto()
-...     GREEN = auto()
-... 
->>> Color.GREEN
-<Color.GREEN: 3>
-\end{python}
-
-\subsection{Using \lstinline{object}}
-
-Using @object@ would look like:
-\begin{python}
->>> class Color(Enum):
-...     RED = object()
-...     GREEN = object()
-...     BLUE = object()
-... 
->>> Color.GREEN                         
-<Color.GREEN: <object object at 0x...>>
-\end{python}
-This is also a good example of why you might want to write your own @__repr__()@:
-\begin{python}
->>> class Color(Enum):
-...     RED = object()
-...     GREEN = object()
-...     BLUE = object()
-...     def __repr__(self):
-...         return "<%s.%s>" % (self.__class__.__name__, self._name_)
-... 
->>> Color.GREEN
-<Color.GREEN>
-\end{python}
-
-\subsection{Using a descriptive string}
-
-Using a string as the value would look like:
-\begin{python}
->>> class Color(Enum):
-...     RED = 'stop'
-...     GREEN = 'go'
-...     BLUE = 'too fast!'
-... 
->>> Color.GREEN
-<Color.GREEN: 'go'>
-\end{python}
-
-\subsection{Using a custom \lstinline{__new__()}}
-
-Using an auto-numbering @__new__()@ would look like:
-\begin{python}
->>> class AutoNumber(Enum):
-...     def __new__(cls):
-...         value = len(cls.__members__) + 1
-...         obj = object.__new__(cls)
-...         obj._value_ = value
-...         return obj
-... 
->>> class Color(AutoNumber):
-...     RED = ()
-...     GREEN = ()
-...     BLUE = ()
-... 
->>> Color.GREEN
-<Color.GREEN: 2>
-\end{python}
-To make a more general purpose @AutoNumber@, add @*args@ to the signature:
-\begin{python}
->>> class AutoNumber(Enum):
-...     def __new__(cls, *args):      # this is the only change from above
-...         value = len(cls.__members__) + 1
-...         obj = object.__new__(cls)
-...         obj._value_ = value
-...         return obj
-\end{python}
-Then when you inherit from @AutoNumber@ you can write your own @__init__@ to handle any extra arguments:
-\begin{python}
->>> class Swatch(AutoNumber):
-...     def __init__(self, pantone='unknown'):
-...         self.pantone = pantone
-...     AUBURN = '3497'
-...     SEA_GREEN = '1246'
-...     BLEACHED_CORAL = () # New color, no Pantone code yet!
-... 
->>> Swatch.SEA_GREEN
-<Swatch.SEA_GREEN: 2>
->>> Swatch.SEA_GREEN.pantone
-'1246'
->>> Swatch.BLEACHED_CORAL.pantone
-'unknown'
-\end{python}
-Note: The @__new__()@ method, if defined, is used during creation of the Enum members;
-it is then replaced by Enum's @__new__()@ which is used after class creation for lookup of existing members.
-
-Warning: Do not call @super().__new__()@, as the lookup-only @__new__@ is the one that is found;
-instead, use the data type directly -- e.g.:
-\begin{python}
-obj = int.__new__(cls, value)
-\end{python}
-
-\subsection{OrderedEnum}
-
-An ordered enumeration that is not based on @IntEnum@ and so maintains the normal @Enum@ invariants (such as not being comparable to other enumerations):
-\begin{python}
->>> class OrderedEnum(Enum):
-...     def __ge__(self, other):
-...         if self.__class__ is other.__class__:
-...             return self.value >= other.value
-...         return NotImplemented
-...     def __gt__(self, other):
-...         if self.__class__ is other.__class__:
-...             return self.value > other.value
-...         return NotImplemented
-...     def __le__(self, other):
-...         if self.__class__ is other.__class__:
-...             return self.value <= other.value
-...         return NotImplemented
-...     def __lt__(self, other):
-...         if self.__class__ is other.__class__:
-...             return self.value < other.value
-...         return NotImplemented
-... 
->>> class Grade(OrderedEnum):
-...     A = 5
-...     B = 4
-...     C = 3
-...     D = 2
-...     F = 1
->>> Grade.C < Grade.A
-True
-\end{python}
-
-\subsection{DuplicateFreeEnum}
-
-Raises an error if a duplicate member value is found instead of creating an alias:
-\begin{python}
->>> class DuplicateFreeEnum(Enum):
-...     def __init__(self, *args):
-...         cls = self.__class__
-...         if any(self.value == e.value for e in cls):
-...             a = self.name
-...             e = cls(self.value).name
-...             raise ValueError(
-...                 "aliases not allowed in DuplicateFreeEnum:  %r --> %r"
-...                 % (a, e))
->>> class Color(DuplicateFreeEnum):
-...     RED = 1
-...     GREEN = 2
-...     BLUE = 3
-...     GRENE = 2
-... 
-Traceback (most recent call last):
-  ...
-ValueError: aliases not allowed in DuplicateFreeEnum:  'GRENE' --> 'GREEN'
-\end{python}
-Note: This is a useful example for subclassing Enum to add or change other behaviors as well as disallowing aliases.
-If the only desired change is disallowing aliases, the @unique()@ decorator can be used instead.
-
-\subsection{Planet}
-
-If @__new__()@ or @__init__()@ is defined, the value of the enum member will be passed to those methods:
-\begin{figure}
-\begin{python}
-from enum import Enum
-class Planet(Enum):
-	MERCURY = ( 3.303E23, 2.4397E6 )
-	VENUS       = ( 4.869E24, 6.0518E6 )
-	EARTH       = (5.976E24, 6.37814E6)
-	MARS         = (6.421E23, 3.3972E6)
-	JUPITER    = (1.9E27,   7.1492E7)
-	SATURN     = (5.688E26, 6.0268E7)
-	URANUS    = (8.686E25, 2.5559E7)
-	NEPTUNE  = (1.024E26, 2.4746E7)
-	def __init__( self, mass, radius ):
-		self.mass = mass		# in kilograms
-		self.radius = radius	# in meters
-	def surface_gravity( self ):
-		# universal gravitational constant  (m3 kg-1 s-2)
-		G = 6.67300E-11
-		return G * self.mass / (self.radius * self.radius)
-for p in Planet:
-	print( f"{p.name}: {p.value}" )
-
-MERCURY: (3.303e+23, 2439700.0)
-VENUS: (4.869e+24, 6051800.0)
-EARTH: (5.976e+24, 6378140.0)
-MARS: (6.421e+23, 3397200.0)
-JUPITER: (1.9e+27, 71492000.0)
-SATURN: (5.688e+26, 60268000.0)
-URANUS: (8.686e+25, 25559000.0)
-NEPTUNE: (1.024e+26, 24746000.0)
-\end{python}
-\caption{Python Planet Example}
-\label{f:PythonPlanetExample}
-\end{figure}
-
-
-\subsection{TimePeriod}
-
-An example to show the @_ignore_@ attribute in use:
-\begin{python}
->>> from datetime import timedelta
->>> class Period(timedelta, Enum):
-...     "different lengths of time"
-...     _ignore_ = 'Period i'
-...     Period = vars()
-...     for i in range(367):
-...         Period['day_%d' % i] = i
-... 
->>> list(Period)[:2]
-[<Period.day_0: datetime.timedelta(0)>, <Period.day_1: datetime.timedelta(days=1)>]
->>> list(Period)[-2:]
-[<Period.day_365: datetime.timedelta(days=365)>, <Period.day_366: datetime.timedelta(days=366)>]
-\end{python}
-
-\subsection{Subclassing EnumType}
-
-While most enum needs can be met by customizing @Enum@ subclasses, either with class decorators or custom functions, @EnumType@ can be subclassed to provide a different Enum experience.
+	print( f"{day.name}:"
+		   f" {day.value}", end=" " )
+Sat: 32 Sun: 64 
+\end{python}
+\end{tabular}
+\end{cquote}
 
 
@@ -2294,4 +1160,6 @@
 In summary, an OCaml variant is a singleton value rather than a set of possibly ordered values, and hence, has no notion of enumerabilty.
 Therefore it is not an enumeration, except for the simple opaque (nullary) case.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 \begin{comment}
@@ -2442,5 +1310,5 @@
 To: Gregor Richards <gregor.richards@uwaterloo.ca>, Peter Buhr <pabuhr@uwaterloo.ca>
 CC: Michael Leslie Brooks <mlbrooks@uwaterloo.ca>, Fangren Yu <f37yu@uwaterloo.ca>,
-    Jiada Liang <j82liang@uwaterloo.ca>
+	Jiada Liang <j82liang@uwaterloo.ca>
 Subject: Re: Re:
 Date: Thu, 21 Mar 2024 14:26:36 +0000
@@ -2450,7 +1318,7 @@
 
 enum Example {
-    Label,
-    Name = 10,
-    Tag = 3,
+	Label,
+	Name = 10,
+	Tag = 3,
 };
 
@@ -2542,5 +1410,5 @@
 auto-init		&		&		&		&		&		&		&		&	  	&		&		& \CM	& \CM	& \CM	\\
 \hline
-(un)scoped		&		&		&		&		&		&		&		&	  	&		&		& U		& U/S	& U/S	\\
+(Un)Scoped		&		&		&		&		&		&		&		&	  	&		&		& U		& U/S	& U/S	\\
 \hline
 overload		&		& \CM	&		&		&		&		&		&	  	&		&		&		& \CM	& \CM	\\
