Cameron Simpson wrote: > > 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 In Python, that is spelled while True: suite if not invariant: break suite > 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 Good Python programmers do not repeat the setup code like this. See the proper say-it-once way above. This discussion belongs back on Python ideas, where it began and should have stayed. tjr
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