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,74a56083ffbe573d X-Google-Attributes: gid103376,public From: Ted Dennison Subject: Re: Zoo question Date: 1996/08/13 Message-ID: <3210A142.2781E494@escmail.orl.mmc.com>#1/1 X-Deja-AN: 173951175 references: <320F16B6.6944@lmtas.lmco.com> content-type: text/plain; charset=us-ascii organization: Lockheed Martin Information Systems mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.0 (X11; I; SunOS 4.1.3_U1 sun4m) Date: 1996-08-13T00:00:00+00:00 List-Id: Ken Garlington wrote: > > Here's a little brain teaser we received recently. Assuming no typos or > other obvious syntax errors, will the Fill procedure work in Ada 83? OK. I'll bite. It looks like it would probably perform as advertised, with no optimization set on the compiler. The following constraint check code - > > Get_Next_Animal: begin -- look carefully at this code! > Next_Animal := Animal_ID'Succ(Next_Animal); > exception > when others => Next_Animal := Animal_ID'First; > end Get_Next_Animal; isn't guaranteed to work (assuming "work" means raise an execption within this block when Animal_ID'Succ(Next_Animal) > Animal_ID'last). Now, what did I miss? (it can't be that simple) -- T.E.D. | Work - mailto:dennison@escmail.orl.mmc.com | | Home - mailto:dennison@iag.net | | URL - http://www.iag.net/~dennison |