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,203d1f2317947ef5,start X-Google-Attributes: gid103376,public From: Chris Sparks Subject: others clause Date: 1996/08/29 Message-ID: #1/1 X-Deja-AN: 177505850 sender: Ada programming language comments: cc: sparks@billings.aisf.com newsgroups: comp.lang.ada x-mailer: Elm [revision: 112.6] Date: 1996-08-29T00:00:00+00:00 List-Id: 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