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=3.2 required=5.0 tests=BAYES_40,HEADER_SPAM, INVALID_DATE,REPLYTO_WITHOUT_TO_CC,UPPERCASE_50_75 autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!uunet!jarthur!usc!zaphod.mps.ohio-state.edu!ub!uhura.cc.rochester.edu!rochester!kodak!uupsi!bse.com From: eberard@bse.com (Edward V. Berard) Newsgroups: comp.lang.ada Subject: Is There Anything "Wrong" With This Code? Summary: Will this raise the intended exception for the right reason? Keywords: constraint_error Message-ID: Date: 7 Aug 90 16:46:13 GMT Reply-To: eberard@bse.com Organization: Berard Software Engineering, Inc. X-Mailer: UMail Revision: Beta 2.1.0 List-Id: Folks, Does anything bother you about the following section of code? Specifically, can you think of any exceptions which might be raised, and the specific circumstances which will cause them to be raised? DECLARE -- (D2) PROCEDURE P2D (I1, I2 : INTEGER) IS TYPE A1 IS ARRAY (1..2,1..2) OF INTEGER RANGE I1..I2; PROCEDURE P2D1 (A : A1 := (3..4 => (1,2))) IS BEGIN FAILED ("BODY OF P2D1 EXECUTED"); EXCEPTION WHEN OTHERS => FAILED ("EXCEPTION RAISED IN P2D1"); END P2D1; BEGIN P2D1; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED - P2D1"); END P2D; BEGIN -- (D2) P2D (IDENT_INT(1), IDENT_INT(2)); EXCEPTION WHEN OTHERS => FAILED ("EXCEPTION RAISED IN CALL TO P2D"); END; -- (D2) ------------------------------------------------------------------------------- Edward V. Berard | Phone: (301) 353-9652 Berard Software Engineering, Inc. | FAX: (301) 353-9272 18620 Mateney Road | E-Mail: eberard@bse.com Germantown, Maryland 20874 | -------------------------------------------------------------------------------