comp.lang.ada
 help / color / mirror / Atom feed
* others clause
@ 1996-08-29  0:00 Chris Sparks
  1996-08-30  0:00 ` Mike Bishop
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Chris Sparks @ 1996-08-29  0:00 UTC (permalink / raw)



Why is the following not incorrect?

---------------------------------------------------------------------
procedure T is

  type Enum is (A, B, C, D, E, F);

  T1 : Enum    := Enum'First;
  T2 : Integer := 0;

begin
  case T1 is
    when A      => null;
    when B      => null;
    when C      => null;
    when D      => null;
    when E      => null;
    when F      => null;
    when others => null;               --WHY ISN'T THIS ERRONEOUS?
  end case;

  case T2 is
    when Integer'First .. -1 => null;
    when 0                   => null;
    when 1 .. Integer'Last   => null;
    when others              => null;  --WHY ISN'T THIS ERRONEOUS?
  end case;

end T;
---------------------------------------------------------------------
It seems to me that if we have identified all of the possible values,
then other would be invalid.  You can't test for others in the above
two cases!

Any feedback would be appreciated.

Chris Sparks (aka Mr. Ada)
sparks@aisf.com




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~1996-09-03  0:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-08-29  0:00 others clause Chris Sparks
1996-08-30  0:00 ` Mike Bishop
1996-08-31  0:00   ` Robert A Duff
1996-09-02  0:00   ` Brian Rogoff
1996-09-02  0:00   ` Geert Bosch
1996-09-03  0:00     ` Robert Dewar
1996-09-03  0:00   ` Adam Beneschan
1996-08-31  0:00 ` Robert Dewar
1996-09-02  0:00 ` Stephen Bull

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