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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ec4cde5d799065b6 X-Google-Attributes: gid103376,public From: Brian Rogoff Subject: Re: GOTO considered Satanic (was: Is there an ADA analogue to the C++ continue statement?) Date: 1997/09/26 Message-ID: #1/1 X-Deja-AN: 275855619 References: <3422F037.41CA@lmco.com> <3423AF1B.5152@i.b.m.net> <6098m7$a24$1@krusty.irvine.com> To: Matthew Heaney X-Trace: 875321785 10410 (none) 206.86.0.12 Newsgroups: comp.lang.ada Date: 1997-09-26T00:00:00+00:00 List-Id: On Fri, 26 Sep 1997, Matthew Heaney wrote: > In article , > Brian Rogoff wrote: > > > >In another thread, some rather absolute rules concerning exceptions were > >put forth ("don't use exceptions for normal control flow"). While I think > >thats a good guideline, I've also written code that violates that rule and > >was IMO more readable because of it (if you must know, it was in the top > >level loop for an interpreter for a Lisp like language; I used an exception > >to terminate the loop when a (quit) was evaluated). > > Well, there are reasons for not using exceptions for normal control flow: > the famous RM 11.6 (though that section may - I think - only apply to > predefined exceptions; that section still throws me). If you need a goto, > then use a goto, not an exception. I didn't "need" a goto, a quit call can be deeply nested. The efficiency argument is also irrelevant here, as I was quitting. The point is that this is an exception :-) to the absolute rule about exceptions. Jon Anthony's iterator approach in Ada is another. As an aside, Matthew, it is unnecessary to send mail *and* follow up the article. Please learn how to tell your newsreader to just follow up, or just send mail. -- Brian