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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cf677878aa77e0d8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-13 13:51:14 PST Path: archiver1.google.com!newsfeed.google.com!sn-xit-03!supernews.com!skynet.be!dispose.news.demon.net!demon!btnet-peer0!btnet!news5-gui.server.ntli.net!ntli.net!news2-win.server.ntlworld.com.POSTED!not-for-mail From: "chris.danx" Newsgroups: comp.lang.ada References: <3B4F2962.25BB60FF@boeing.com> Subject: Re: an infinate loop MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: Date: Fri, 13 Jul 2001 21:40:17 +0100 NNTP-Posting-Host: 62.253.9.20 X-Complaints-To: abuse@ntlworld.com X-Trace: news2-win.server.ntlworld.com 995056738 62.253.9.20 (Fri, 13 Jul 2001 21:38:58 BST) NNTP-Posting-Date: Fri, 13 Jul 2001 21:38:58 BST Organization: ntlworld News Service Xref: archiver1.google.com comp.lang.ada:9924 Date: 2001-07-13T21:40:17+01:00 List-Id: > > For another, most of your "exit" statements are all at the tops of the loops. In > > those cases you should probably reverse the test logic and use "while" loops > > instead. > > This is bad advice. The form that uses positive logic is best. ? What is positive/negative logic? Do you mean while y is true loop is negative logic, but loop ... exit when x is true is positive logic? I just don't see it? > exit when End_Of_File; > > uses positive logic, and is better than > > while not End_Of_File loop > > which uses negative logic. All of the exits in this program use positive > logic. In general, exit tends to use positive logic and while tends to > use negative logic. I don't get it. Can you explain this to me? All my tutors and lecturers say while is better than loop for most occasions. All the books i've read say the same. Is this just a matter of style? [ I did wonder about Beau's use of loop exit and he/she (I don't know if that's a masculine name or a feminine name) said the tutors recommend loop over while, which I thought curious since I've always learned it the other way.] > At the "Ada Launch" (1980 Dec 10), Ichbiah, Barnes, and Firth introduced > the recently renamed Ada language (MIL-STD 1815, formerly Green, now > known as Ada 80) to the world. They said "while" was in the language > primarily to support translation from languages such as Pascal, and > advised using the "loop ... exit when" format in new code. Oh, so Ada might have ended up wirth no while had there been no concern for translation between Ada and other languages? TBH: I prefer the info at the top of structures so i don't have go far to find it. Getting the conditions right is easier (for me) if this is the case. procedures, functions, while, for, discriminant records/tasks, etc all have the conditions and info at the top, which I find better for me. It's just a preference, and I have no difficulty with other ppl using different schemes. I'd just like to know what all the fuss is about i guess. Chris