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: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: Zoo question Date: 1996/08/15 Message-ID: #1/1 X-Deja-AN: 174368144 references: <3211EA8F.167EB0E7@escmail.orl.mmc.com> <4usukc$p47@zeus.orl.mmc.com> organization: The Mitre Corp., Bedford, MA. newsgroups: comp.lang.ada Date: 1996-08-15T00:00:00+00:00 List-Id: In article <321207F7.4D24@lmtas.lmco.com> Ken Garlington writes: > Under what circumstances would it be acceptable to not generate a > range check when assigning a value of 6 to an object declared with > range 1 .. 5? Hardware failure or a program which was already erroneous. (Please, no religous decussion over what forms of reasoning from erroneousness are acceptable. Save that for ARG meetings. ;-) Seriously the Zoo program as posted doesn't raise any serious issues. The programmer may expect the 'SUCC call to raise Contraint_Error, but it will be raised immediately afterwords. Now if the variable is declared to be of the base type not the subtype, there is a hard to find bug, but Ada makes it real hard to code that way. In fact I suspect that that was the intended program, and it got corrected automatically by the author as it was being typed in. I've run into this problem before in ARG discussions, it is often hard to post code fragments which correctly demonstrate an anomaly because my fingers automatically clean up the poor code as I type it. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...