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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!think!nike!ll-xn!adelie!mirror!cca!holden From: holden@cca.UUCP (Russ Holden) Newsgroups: net.lang.ada Subject: Exception handling question Message-ID: <10377@cca.UUCP> Date: Thu, 2-Oct-86 17:03:50 EDT Article-I.D.: cca.10377 Posted: Thu Oct 2 17:03:50 1986 Date-Received: Sat, 4-Oct-86 10:07:03 EDT Organization: Computer Corp. of America, Cambridge List-Id: The following language fragment (in a slightly different form) was written here (really!). It was found to perform differently on the Rational and VAX/VMS compilers. On the Rational "Missed it" is printed while on VMS "Got it" is printed. Logic and the LRM both seem to indicate that the innermost handler should get control and "Got it" should be printed. Section 11.4 says that "The selection of this handler depends on whether the exception is raised during the execution of statements or during the elaboration of declarations". It says nothing about whether the exception is raised with using a "raise" or a "raise " as some here have claimed. Is this right? with Textio; procedure Foo is Bar : exception; begin begin begin raise Bar; exception when Bar => begin raise; exception when Bar => Textio.Put_Line("Got it"); end; end; exception when Bar => Textio.Put_Line("Missed it"); end; end Foo; -- Russell Holden Computer Corporation of America Four Cambridge Center Cambridge, MA 02142