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: fac41,9a0ff0bffdf63657 X-Google-Attributes: gidfac41,public X-Google-Thread: f43e6,9a0ff0bffdf63657 X-Google-Attributes: gidf43e6,public X-Google-Thread: 1108a1,9a0ff0bffdf63657 X-Google-Attributes: gid1108a1,public X-Google-Thread: 103376,4b06f8f15f01a568 X-Google-Attributes: gid103376,public From: Patrick Logan Subject: Re: Software landmines (loops) Date: 1998/10/05 Message-ID: #1/1 X-Deja-AN: 397825611 References: <6qfhri$gs7$1@nnrp1.dejanews.com> <6sfcft$70p$1@hirame.wwa.com> <1dg8p3r.vfredh1aou58iN@n207167116191.inetworld.net> <6v2nr9$t8l$1@hirame.wwa.com> <1dgane6.16owv2g7g8ov8N@u2n207167116151.inetworld.net> <1dge7py.7401x8z7ne24N@u2n207167116162.inetworld.net> Organization: Teleport - Portland's Public Access (503) 220-1016 NNTP-Posting-Date: Sun, 04 Oct 1998 23:40:11 PDT Newsgroups: comp.lang.eiffel,comp.object,comp.software-eng,comp.lang.ada Date: 1998-10-05T00:00:00+00:00 List-Id: In comp.object Reimer Behrends wrote: : > : > loop : > : > exit : > : > end loop : > : > Please point out the two exits... : : exit : : It has an exit at the "exit" statement, and one at the end of , where control flow leaves the body to reenter at the top. And : I'm not kidding you. Try to put the loop body into a procedure of its : own, and this becomes very visible. (Ease of procedural decomposition is : usually one of the benefits of strict single-entry, single-exit : structures.) Well, you can easily put this into *two* procedures and end up with a "structured program"... void first_part() { if (!condition) second_part(); } void second_part() { first_part(); } ...maybe a measure of the degree of "structuredness" of a loop is *how many* well structured procedures result from the conversion? -- Patrick Logan (H) mailto:plogan@teleport.com (W) mailto:patrickl@gemstone.com http://www.gemstone.com