comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam@spam.com>
Subject: Re: do while loop help ( newbie)
Date: Sun, 05 Feb 2006 22:25:02 GMT
Date: 2006-02-05T22:25:02+00:00	[thread overview]
Message-ID: <2XuFf.5355$5E3.3412@newsread1.news.pas.earthlink.net> (raw)
In-Reply-To: <c3uFf.43920$d5.199938@newsb.telia.net>

Bj�rn Persson wrote:

> None of those are as clean as a loop-and-a-half with "exit when". What's 
> wrong with "exit when"?

It's not even a loop and a half. It's a full loop with the test at the end.

At the Ada Launch, 1980 Dec 10, Ichbiah, Barnes, and Firth introduced their new 
language (now called Ada 80). They said "while" was included in the language 
only to facilitate automated translation from other languages. For new code, 
they recommended not using "while", since it often involves negative logic, and 
the condition (True to continue the loop) is opposite the intuitive condition 
(True to exit the loop).

-- 
Jeff Carter
"Pray that there's intelligent life somewhere up in
space, 'cause there's bugger all down here on earth."
Monty Python's Meaning of Life
61



  reply	other threads:[~2006-02-05 22:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-04 23:16 do while loop help ( newbie) isaac2004
2006-02-05  2:01 ` jimmaureenrogers
2006-02-05  8:03   ` Pascal Obry
2006-02-05 12:18   ` Stephen Leake
2006-02-05  2:07 ` Jeffrey R. Carter
     [not found] ` <bjfau11bp7g4b5id8vprbai6bc81qfgr96@4ax.com>
2006-02-05  4:39   ` isaac2004
2006-02-05 21:25     ` Björn Persson
2006-02-05 22:25       ` Jeffrey R. Carter [this message]
2006-02-06  1:01         ` Björn Persson
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox