> My "favorite" infinte loop with while is: > > i = 0 > while i < 20: > do_process(i) > > Note the prominent *lack* of any change to i here? > > Oh, for: > > from i = 0 > invariant 0 <= i <= 20 > variant 21 - i > until i > 19 > loop > do_process(i) > > which throws an exception at the beginning of the second loop.
What language is that from? I take it the exception is from the "21-i" not changing as it goes around the loop, right? (But why can't "variant i" work just as well?) -- http://mail.python.org/mailman/listinfo/python-list