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-14 09:30:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!feed.news.nacamar.de!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> Subject: Re: Test for > 'last Date: Fri, 14 Mar 2003 17:22:59 -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: <3e721008$0$895$9b0f33e3@clyde> NNTP-Posting-Host: 10.192.81.113 X-Trace: 1047662600 clyde 895 10.192.81.113 Xref: archiver1.google.com comp.lang.ada:35331 Date: 2003-03-14T17:22:59+00:00 List-Id: "Peter Richtmyer" wrote in message news:1b585154.0303140406.124c3312@posting.google.com... > This may be trivial, but I have come across some code > in a (weapon control) system that does checks similar > to: > > --------------------------------------- > if enum_input < enum_type'first or > enum_input > enum_type'last then > -- handle the input error > --------------------------------------- [...] > But I am wondering whether people think the original code > is OK, sort of wrong, really grossly wrong, or what. I would rather do this: if enum_input not in enum_type'first .. enum_type'last then -- handle error end if;