REPEAT... UNTIL ?

Andrae Muys amuys at shortech.com.au
Thu Jul 4 21:13:05 EDT 2002


Ingo Linkweiler <i.linkweiler at gmx.de> wrote in message news:<3D2487CB.9000102 at gmx.de>...
> I know that I can use a while loop with break instead of repeat-until. I 
> am using it, but I just think a repeat-until looks better. If nobody 
> else has this opinion: Let's forget my stupid question <8-)
> 

Two comments:

Please do a google-groups search for "repeat until do while" in c.l.p,
once you've finished reading all the past discussion on this topic
I'll join you in celebrating the start of the 4th millenium ;).  Of
course to summarise, you will ask about adding a post-tested loop to
python;  somebody will reply that they use while 1:/if:break;  you
will suggest you don't like while 1:; eventually the noise will wake
up the martelli-bot who will rave about Knuthian N-1/2 loops and
generic looping constructs;  the thread will petter out and lie
dormant until next time.

IOW, you're going to have to do alot better then a two line post if
you want to overcome the inertia this issue has achived over the
years.

Personally I couldn't care less, if I find myself writing any form of
explicit loop I tend to consider it an algorithmic flaw.  So I tend to
use list comprehensions, and occasionally map().  Of course I
recognise that sometimes a foreach loop (written for..in..: in python)
is cleaner, and less regularly a while-loop, but when it comes to
aesthetics by the time I get to a while loop, using while 1:/if:break
is a trivial matter.

Andrae



More information about the Python-list mailing list