comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Ada 95 case statement incompatibility?
Date: 1996/08/29
Date: 1996-08-29T00:00:00+00:00	[thread overview]
Message-ID: <DwwpIJ.C16@world.std.com> (raw)
In-Reply-To: 4vv4bs$hb8@erlang.praxis.co.uk


In article <4vv4bs$hb8@erlang.praxis.co.uk>,
Gavin Finnie <gavin@praxis.co.uk> 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




      parent reply	other threads:[~1996-08-29  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-08-27  0:00 Ada 95 case statement incompatibility? Gavin Finnie
1996-08-27  0:00 ` Michael F Brenner
1996-08-28  0:00   ` Norman H. Cohen
1996-08-28  0:00     ` Robert Dewar
1996-08-28  0:00   ` Robert Dewar
1996-08-28  0:00 ` Robert Dewar
1996-08-28  0:00   ` Gavin Finnie
1996-08-29  0:00 ` Robert A Duff [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox