<br><br><div class="gmail_quote">On Mon, Oct 19, 2009 at 1:55 PM, inhahe <span dir="ltr"><<a href="mailto:inhahe@gmail.com">inhahe@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br><br><div class="gmail_quote">On Sat, Oct 10, 2009 at 6:34 PM, Mensanator <span dir="ltr"><<a href="mailto:mensanator@aol.com" target="_blank">mensanator@aol.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

On Oct 10, 5:02�pm, kj <no.em...@please.post> wrote:<div class="im"><br>
<div><div></div><div>> In <<a href="mailto:01ccc46d-5ea9-4dfe-ba22-699c6b859...@v36g2000yqv.googlegroups.com" target="_blank">01ccc46d-5ea9-4dfe-ba22-699c6b859...@v36g2000yqv.googlegroups.com</a>> Mensanator <<a href="mailto:mensana...@aol.com" target="_blank">mensana...@aol.com</a>> writes:<br>

><br>
> In fact, if it were up to me, I would have made the fundamental<br>
> looping construct something like<br>
><br>
> repeat:<br>
> � � � ...<br>
> � � � if whatever():<br>
> � � � � � �break<br>
</div></div></div>> � � � ...<br>
<br>
So, the second set of '...' doesn't get executed.<br>
<br>
When I use<br>
<br>
while not done:<br>
    ...<br>
    if n==1: done = True<br>
    ...<br>
<br>
the loop will actually complete (which is what<br>
I want) instead of aborting, like yours does.<br>
I just don't want the loop to execute again.<br>
<br></blockquote><div><br></div><div>Of course, this is why you would use "while not done" instead of "while True" or "repeat" in that situation, so i'm not sure what your contention is.</div>

<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Now, if I did a break before writing to the file,<br>
I would have to do all kinds of clean-up code<br>
outside the loop, code that would be run only<br>
if the exit were abnormal.<br>
<div><br>
</div></blockquote><div><br></div><div>This is why I propose an "until" keyword.  </div><div><br></div><div>until n == 1:</div><div>  ...</div><div><br></div><div>i know some people don't like to add keywords "unnecessarily," but i really like to be able to express programs in a way that reflects what we actually mean, when there's a simple way this could be provided and it's a common use case.</div>

<div><br></div><div>i recognize the problem with my solution is that "n" might not even be defined until somewhere in the loop after "until n == 1" is evaluated.  this makes it a little weird, but it's not strictly a problem since the interpreter doesn't actually have to evaluate "n == 1" until the tail end of the loop. </div>

<div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><div>><br>
> and made all the other looping constructs as syntatic sugar for<br>
> this one.<br>
<br>
</div></div>Luckily, it's not up to you.<br></blockquote><div><br></div><div>condescending and manipulative, as it merely begs the question of luckily for whom -- him, or you</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><div></div><div><br>
><br>
> kj<br>
<br>
--<div class="im"><br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></div></blockquote></div><br>
</blockquote></div><br>