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-Thread: 103376,cd5005cccfba0311 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns14feed!worldnet.att.net!attbi_s21.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Topological Sort Help References: <1170618852.885855.258390@j27g2000cwj.googlegroups.com> <87sldllhpt.fsf@ludovic-brenta.org> <1170707421.136089.281290@l53g2000cwa.googlegroups.com> <87y7ncjq4y.fsf@ludovic-brenta.org> <1170728294.194370.133540@k78g2000cwa.googlegroups.com> <1170752808.678318.252960@l53g2000cwa.googlegroups.com> <1170897552.495666.223180@v33g2000cwv.googlegroups.com> <1170960817.632329.117990@v45g2000cwv.googlegroups.com> In-Reply-To: <1170960817.632329.117990@v45g2000cwv.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s21 1170997076 12.201.97.213 (Fri, 09 Feb 2007 04:57:56 GMT) NNTP-Posting-Date: Fri, 09 Feb 2007 04:57:56 GMT Organization: AT&T ASP.att.net Date: Fri, 09 Feb 2007 04:57:56 GMT Xref: g2news2.google.com comp.lang.ada:9167 Date: 2007-02-09T04:57:56+00:00 List-Id: isaac2004 wrote: > an exit when makes no sense in this situation because there is no > finite stopping condition, if you look at the algorithm provided, i > see it harder top implement an exit when loop > > WHILE IsEmpty(G) /= False DO This kind of construct generally indicates the coder doesn't understand the concept of Booleans. There's always an "exit when" equivalent to a while loop. Your loop is equivalent to while Isempty (G) loop which is equivalent to loop exit when not Isempty (G); Note that I'm not dealing with your algorithm here; I'm merely suggesting that if you're having trouble with the condition for continuing the loop, you might find it easier to think in terms of the condition for exiting the loop. -- Jeff Carter "What I wouldn't give for a large sock with horse manure in it." Annie Hall 42