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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,9a0ff0bffdf63657 X-Google-Attributes: gidfac41,public X-Google-Thread: 1108a1,9a0ff0bffdf63657 X-Google-Attributes: gid1108a1,public X-Google-Thread: f43e6,9a0ff0bffdf63657 X-Google-Attributes: gidf43e6,public X-Google-Thread: 103376,4b06f8f15f01a568 X-Google-Attributes: gid103376,public From: ell@access.digex.net (Ell) Subject: Re: Software landmines (loops) Date: 1998/10/06 Message-ID: <361bcc75.29858784@news.erols.com>#1/1 X-Deja-AN: 398195530 Content-Transfer-Encoding: 7bit References: <35DBDD24.D003404D@calfp.co.uk> <6sbuod$fra$1@hirame.wwa.com> <35f51e53.48044143@news.erols.com> <6sdiav$e0g$1@hirame.wwa.com> <6sfcft$70p$1@hirame.wwa.com> <1dg8p3r.vfredh1aou58iN@n207167116191.inetworld.net> <6v2nr9$t8l$1@hirame.wwa.com> <6v39i0$fte$1@winter.news.erols.com> <6v4d5l$blb$1@hirame.wwa.com> <6v5en9$d46$1@winter.news.erols.com> Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@rcn.com X-Trace: winter.news.erols.com 907660702 19558 207.172.52.49 (6 Oct 1998 07:58:22 GMT) Organization: Universe Mime-Version: 1.0 Reply-To: ell@access.digex.net Newsgroups: comp.lang.eiffel,comp.object,comp.software-eng,comp.lang.ada Date: 1998-10-06T00:00:00+00:00 List-Id: NOSPAMmbkennelNOSPAM@yahoo.com (Matt Kennel) wrote: >On Sat, 3 Oct 1998 11:02:08 -0400, John I. Moore, Jr. wrote: >:2. Mills construct of do-while-do has a single entry and single exit, >: as do all of the other structured programming constructs. Using >: an Ada-like syntax, consider the following: >: >: loop >: get x; >: exit when x satisfies some condition; >: process x; >: end loop; >: >: I contend that this logic is natural, that the loop has only a >: single entry and exit, and that it doesn't violate any of the >: structured programming guidelines. Of course, one can rewrite >: it by using a standard while-loop, just as one can rewrite any >: repeat-until loop using a while-loop, but in order to do so you >: must repeat some part of the logic outside of the loop. > >Why is that loop morally superior to one like > > loop > get x; > exit when x satisfies some condition; > partially process x; > exit if the preliminary processing shows something wrong > continue to process x; > end loop; > >Which does not have a single exit? This one: >: loop >: get x; >: exit when x satisfies some condition; >: process x; >: end loop; based on discussion I think should really be: loop get x; exit when x satisfies some condition; process x; reloop; Elliott -- :=***=: VOTE NO TO MODERATION! :=***=: CRAFTISM SHOULD NOT USE USENET RESOURCES TO AVOID CRITICISM! MODERATORS SHOULD NOT HAVE LIFETIME TERMS! :=***=: Objective * Pre-code Modelling * Holistic :=***=: Hallmarks of the best SW Engineering Study Phony Crafite OO vs. Genuine OO: http://www.access.digex.net/~ell Copyright 1998 Elliott. exclusive of others' writing. may be copied without permission only in the comp.* usenet and bitnet groups.