From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,483a6309b2450e41 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Ada 95 case statement incompatibility? Date: 1996/08/29 Message-ID: #1/1 X-Deja-AN: 177333345 references: <4vv4bs$hb8@erlang.praxis.co.uk> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-08-29T00:00:00+00:00 List-Id: In article <4vv4bs$hb8@erlang.praxis.co.uk>, Gavin Finnie wrote: > type A is array (1..10) of integer; > subtype S is integer range A'FIRST..A'LAST; -- static in 95, but not in 83 > x : S; > ... > case x is > when integer'FIRST..3 => ... ; > when 4..6 => ... ; > when 7..integer'LAST => ... ; > -- legal Ada 83 since all values of S'BASE *must* be covered > -- illegal Ada 95 since S is now static, so only 1 to 10 allowed > end case; Yes, we missed that one. >A similar problem occurs if the expression is a call to a function which >returns a value of a static subtype, since a function call is a name in Ada 95 >but not in Ada 83. This one is documented in the AARM (see 5.4(18.b)), which is where the language design team put such information. It may have gotten added rather late in the process, causing it to be missed in the Rat and the Compat Guide. >In practice, these problems are not likely to occur in many programs ... Indeed. - Bob