On 21Jan2009 14:02, Tres Seaver <tseaver at palladion.com> wrote: | Vitor Bosshard wrote: | > BTW, there is already an "until" keyword in python, it's called "while not" ;) | | 'until' is used at least in some languages (Pascal, Modula*, maybe Ada?) | for a "terminate at bottom" loop (one guaranteed to run at least once): | in such cases, the predicate has the negative sense. This is a particular flavour of "do ... while" which just happens to read a little better in English. It does sometimes bother me that Python doesn't have do...while when I find my self replicating the loop bottom above the loop. Back at uni we had to implement a small language in our compilers class and the lecturer had specified a proper generic while loop, thus: loop: suite while invariant suite endloop I think the keywords were better than above, but it neatly handled the fact that the while-test must often be preceeded by some setup that would be replicated at the loop bottom in Python and many other languages: setup-invariant-state while test-invariant do stuff setup-invariant-state of which the bare while... and converse do...while loops are particular extremes. Cheers, -- Cameron Simpson <cs at zip.com.au> DoD#743 http://www.cskk.ezoshosting.com/cs/ Why doesn't DOS ever say EXCELLENT command or filename?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4