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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,459feef56669b92d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-03 06:06:40 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!freenix!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: christoph.grein@eurocopter.com Newsgroups: comp.lang.ada Subject: Re: "continue/next" for "loop" Date: Mon, 3 Nov 2003 14:45:40 +0100 (MET) Organization: Cuivre, Argent, Or Message-ID: Reply-To: grein@egypt.otn.eurocopter.de NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-Trace: melchior.cuivre.fr.eu.org 1067868013 9574 80.67.180.195 (3 Nov 2003 14:00:13 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Mon, 3 Nov 2003 14:00:13 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: X-Authentication-Warning: mail.eurocopter.com: uucp set sender to using -f Content-MD5: uK844OO1IkcIBDSPaiwPgg== X-Mailer: dtmail 1.2.1 CDE Version 1.2.1 SunOS 5.6 sun4u sparc X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Gateway to the comp.lang.ada Usenet newsgroup List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:1977 Date: 2003-11-03T14:45:40+01:00 Really, Lutz, I do not see why you by any force would like a solution without goto. It's the most appropriate solution in this case! The goto solution is better understandable than the boolean condition one. And it's simpler. Has anyone noticed that More_Statments are missing in the non-goto solution? Why is the goto braindead? Your coding standards forbit it? I hate those silly standards which forbid the most natural solution. > Lutz Donnerhacke wrote in > news:slrnbqckoa.m1.lutz@taranis.iks-jena.de: > > > But both are the result of an oversimplification! > > > > outer: loop > > inner: loop > > Complex_Actions_1; > > if First_Condition then > > Some_Justify_Actions; > > goto next_outer; > > end if; > > Complex_Actions_2; > > if Second_Condition then > > Some_Other_Justify_Actions; > > goto next_outer; > > end if; > > Complex_Actions_3; > > end loop inner; > > Complex_End_Statments; > > exit outer when Other_Condition; > > More_Statments; > > > > <> null; > > end loop outer; > > declare > Outer_Continue : boolean; > begin > outer: loop > inner : loop > Complex_Actions_1; > if First_Condition then > Some_Justify_Actions; > Outer_Continue := false; > exit inner; > end if; > Complex_Actions_2; > if Second_Condition then > Some_Other_Justify_Actions; > Outer_Continue := false; > exit inner; > end if; > Outer_Continue := true; > Complex_Actions_3; > end loop inner; > if Outer_Continue then > Complex_End_Statements; > exit outer when Other_Condition; > end if; > end loop outer; > > > Jim Rogers