home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / ada / 3899 < prev    next >
Encoding:
Text File  |  1993-01-06  |  1.5 KB  |  41 lines

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