home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.ada
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!sgiblab!sgigate!sgi!wdl1!wdl39!mab
- From: mab@wdl39.wdl.loral.com (Mark A Biggar)
- Subject: Re: Semantics Question
- Message-ID: <1993Jan6.181034.4367@wdl.loral.com>
- Sender: news@wdl.loral.com
- Organization: Loral Western Development Labs
- References: <9300612.21535@mulga.cs.mu.OZ.AU>
- Date: Wed, 6 Jan 1993 18:10:34 GMT
- Lines: 29
-
- In article <9300612.21535@mulga.cs.mu.OZ.AU> fraser@munta.cs.mu.OZ.AU (Fraser Wilson) writes:
- >Hi. I have a small question regarding exceptions, the answer to which
- >I couldn't find in the ARM. Basically, what happens if you raise a
- >local exception, but don't handle it before the end of the block in which
- >it is declared. Like this:
- >procedure p is
- > procedure q is
- > e : exception;
- > begin
- > raise e;
- > end q;
- >begin
- > q;
- >end p;
- >Is the result defined somewhere, or not? If there are handlers in
- >subprograms that call p, and they handle any exception (ie, with an
- >others clause), will they catch e? Should the program abort as soon
- >as it leaves e's scope?
-
- This is well defined. See LRM 11.2.5. Exceptions whose names are not visible
- in the curent scope (this includes excetptions propagated out of scope) can be
- handled using a "when others =>" exception handler. Ada9x does the same thing
- but also provides a method of getting a name string for the exception so that
- at least you can output a reasonable report before dying.
-
- --
- Mark Biggar
- mab@wdl1.wdl.loral.com
-
-