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,9b2046241520981f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-27 20:11:07 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.airnews.net!cabal12.airnews.net!usenet From: "John R. Strohm" Newsgroups: comp.lang.ada Subject: Re: Ada 0x, exception idea ? Date: Sun, 27 Jul 2003 21:46:19 -0500 Organization: Airnews.net! at Internet America Message-ID: References: <3F229597.3090909@myob.com> Abuse-Reports-To: abuse at airmail.net to report improper postings NNTP-Proxy-Relay: library1-aux.airnews.net NNTP-Posting-Time: Sun, 27 Jul 2003 22:10:02 -0500 (CDT) NNTP-Posting-Host: !dqX+1k-W%]YV(B (Encoded at Airnews!) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Xref: archiver1.google.com comp.lang.ada:40888 Date: 2003-07-27T21:46:19-05:00 List-Id: "Wesley Groleau" wrote in message news:LGadnTxRQ9xh8bmiU-KYvg@gbronline.com... > sk wrote: > > wesgroleau@myrealbox.com : > > > case C_function (params) is > > > > > > when 0 => null; -- success > > > when Bummer => raise Its_a_Bummer; > > > when Darn => raise Darn_it; > > > when Blast => raise Blast_It; > > > when Disaster => raise Program_Error; > > > > > This still seems a bit "visually-bulky" (for want > > of a better expression) but interesting and cleaner > > than possible pages of "if-then-elsif" before > > resuming with the original purpose of the algorithm. > > Why is the above (which works now) more "bulky" > than the requested > > raise Its_A_Bummer when Result = Bummer; > raise Darn_It when Result = Darn; > raise Blast_It when Result = Blast; Observe that you get PRECISELY the same result with if Result = Bummer then raise Its_A_Bummer; end if; if Result = Darn then raise Darn_It; end if; if Result = Blast then raise Blast_It; end if;