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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fd8f3d2ebf73a4b7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-22 02:23:33 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!128.39.3.168!uninett.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: Whether to raise exception or End_of_List function Date: Thu, 22 Nov 2001 10:23:33 +0000 (UTC) Organization: Norwegian university of science and technology Message-ID: References: <9tht9e$2j1ni$4@ID-25716.news.dfncis.de> NNTP-Posting-Host: kiuk0156.chembio.ntnu.no X-Trace: tyfon.itea.ntnu.no 1006424613 17977 129.241.83.82 (22 Nov 2001 10:23:33 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Thu, 22 Nov 2001 10:23:33 +0000 (UTC) User-Agent: slrn/0.9.7.2 (Linux) Xref: archiver1.google.com comp.lang.ada:16841 Date: 2001-11-22T10:23:33+00:00 List-Id: On Thu, 22 Nov 2001 03:53:15 -0000, Nick Roberts wrote: > "Preben Randhol" wrote in message > news:slrn9vntpg.7nm.randhol+abuse@kiuk0156.chembio.ntnu.no... >> ... >> As I also read >> that exceptions can be a monstrosity if over used. > > And sometimes a piece of code can become a monstrosity (in terms of a > proliferation of if-then-elses or whatever) if exceptions are underused. > Indeed, sometimes the neophyte attempting to avoid using the humble 'goto' > can end up in a similar mess. Very true. > When should one use exceptions? Exceptionally. The clue is in the name ;-) Yes :-) [snipped good example] > Much better, eh? If more detailed diagnostics are required, one can always > use Ada.Exceptions and provide extra information in the Message parameter > when calling the Raise_Exception procedure. Yes think that is smart so that it is easier to locate the problem. Preben -- () Join the worldwide campaign to protect fundamental human rights. '||} {||' http://www.amnesty.org/