[Python-ideas] Updating PEP 315: do-while loops

Ben Finney ben+python at benfinney.id.au
Tue Apr 28 01:46:48 CEST 2009


spir <denis.spir at free.fr> writes:

> [off list -- because it's a side-issue]

Actually, you replied on-list, so I'll feel free to do the same :-)

> Le Mon, 27 Apr 2009 13:58:39 +0900,
> "Stephen J. Turnbull" <stephen at xemacs.org> s'exprima ainsi:
> 
> > Your suggestion of "until <condition>:" may be the best of the lot,
> > but it's ambiguous for the same reasons "do ... while <condition>:"
> > is.
> > Many people will read that as "while not <condition>:".
> 
> My opinion about that is the following:
> * A new keyword is enough to force the reader to consider the code
> with attention and expect something different.

You can't have it both ways, though: The keyword ‘until’ is already
strongly associated with certain behaviour in other programming
languages, which is presumably a strong reason to choose it for this
instance. But it also has a strong English-language relationship with
‘while’.

> * Obviously 'until' cannot have the same meaning as 'while' -- rather
> the opposite in fact. Don't you think so? (english is not my mother
> tongue)

That's exactly what Stephen's saying: “until <condition>” and “while
not <condition>” are fungible in English.

> Denis

Denis, could you please change your From field so that it shows the name
“Denis Spir” which you're clearly happy to be known as?

-- 
 \        “It is the responsibility of intellectuals to tell the truth |
  `\                    and to expose lies.” —Noam Chomsky, 1967-02-23 |
_o__)                                                                  |
Ben Finney




More information about the Python-ideas mailing list