On Thu, 15 Dec 2005 14:57:18 +0000 in comp.lang.python, Steve Holden
<[EMAIL PROTECTED]> wrote:

[...]
>Would you say
>
>     do:
>         suite
>     while condition
>
>or what? Basically do ... while and do ... until most naturally put the 

Works for me, though I wouldn't cry if the "while" was changed to
"until" to make the difference between this form and the "while" loop
more obvious.  I don't think there's a good argument for _both_
do-while and do-until, but one or the other would be useful.

The biggest objection I see is the addition of one or two more
keywords, but I don't recall using "do" or "until" as a name in any of
my programs...

>test after the loop body (suite), and it's difficult to think of a 
>consistent and natural syntax for expressing the construct. Not that 
>this stopped lots of people from coming forward with their personal 
>favourites ... some suggestions even offered "n and a half" looping 
>possibilities.

Syntax is the problem?  Specifically the position of the condition
after the loop body?  How do you explain the syntax of the new Python
ternary operation, with the test in the middle, even though it
logically has to be done first?

Right now, I tend to write these loops something like

   while 1:
      do_stuff()
      if exit_condition: break

which offends my sense of aesthetics, but it works.

Regards,
                                        -=Dave

-- 
Change is inevitable, progress is not.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to