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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,dc82506adceed418 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-17 03:35:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.ems.psu.edu!news.litech.org!eurocyber.net!newsfeed.muc.eurocyber.net!newsfeed.stueberl.de!feed.news.insnet.cw.net!itchen!clyde!not-for-mail From: "Ant" Newsgroups: comp.lang.ada References: <1b585154.0303140406.124c3312@posting.google.com> <3e721008$0$895$9b0f33e3@clyde> Subject: Re: Test for > 'last Date: Mon, 17 Mar 2003 11:28:21 -0000 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Message-ID: <3e75b1af$0$900$9b0f33e3@clyde> NNTP-Posting-Host: 10.192.81.113 X-Trace: 1047900591 clyde 900 10.192.81.113 Xref: archiver1.google.com comp.lang.ada:35404 Date: 2003-03-17T11:28:21+00:00 List-Id: "Vinzent Hoefler" wrote in message news:b4t635$22plon$1@ID-175126.news.dfncis.de... >"Ant" wrote: [...] >>I would rather do this: >> >>if enum_input not in enum_type'first .. enum_type'last then >> -- handle error >>end if; > >And would be wrong, too, if enum_input also has the type enum_type. > >If you look closer to this, this statement does not make sense and the >compiler is indeed not required to check this, because the contract >tells him, this condition will *always* be false (even if in fact it >might not be). What else should a enum_input contain than some value >of enum_type? > >Either use 'Valid or use a type that is allowed to contain values >outside the range of the type to be compared with. Yes. I can see it's all nonesense now, in the context of enumerated types. I was looking at the test, and stating my preference for the use of 'x in y .. z', rather than 'x < y or x > z ' type of construct.