CVS difference for ai12s/ai12-0214-2.txt

Differences between 1.2 and version 1.3
Log of other versions for file ai12s/ai12-0214-2.txt

--- ai12s/ai12-0214-2.txt	2018/06/08 00:00:47	1.2
+++ ai12s/ai12-0214-2.txt	2018/06/12 05:28:47	1.3
@@ -1588,3 +1588,66 @@
 bit of syntactic sugar), and they'd be many times easier to define.
 
 ****************************************************************
+
+From: Jean-Pierre Rosen
+Sent: Friday, May 18, 2018  8:51 AM
+
+Here is another possibility for extending the case statement. It is mostly the 
+case statement from the CHILL language (CCITT High Level Language). This 
+variant is intended to ease the writing of state automatons.
+
+Syntax:
+case <variable list> is
+  when <choices list> is => <statements list>
+  ...
+end case;
+
+All usual rules for case statements apply, only that you specify a list of 
+variables, and for each path a matching list of values. The path is chosen 
+if all variable values match.
+
+case I, J is
+   when 1..10, 1..10 => -- both indices in top left of matrix
+   when others => ...
+end case;
+
+The same can be achieved with nested case statement, with lots of duplications
+and less readable structure.
+
+----
+Improvement:
+Alternatively, <variable list> could be a record variable whose components are 
+all discrete, or an array of static size and discrete components. The 
+<choices list> would be required to have the same number of choices as the 
+number of components of the record/array
+
+----
+Any interest?
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Friday, May 18, 2018  6:07 PM
+
+> case I, J is
+>    when 1..10, 1..10 => -- both indices in top left of matrix
+>    when others => ...
+> end case;
+> 
+> The same can be achieved with nested case statement, with lots of 
+> duplications and less readable structure.
+
+I like this better than AI12-0214-1, as the extension of an existing 
+implementation to support it is much more obvious. It's definitely less
+powerful (no embedded wildcards) but also a lot easier to describe (because
+there's no embedded wildcards :-). It doesn't have to deal with extra 
+components (just don't write them in the expression) and variants and all of 
+that mess.
+
+Probably the real downside for composites is the need to repeat the prefix:
+
+   case <lengthy-prefix>.Height, <lengthy-prefix>.Width is
+
+Might be worth it for the other advantages.
+
+****************************************************************

Questions? Ask the ACAA Technical Agent