Hrvoje Niksic wrote:
greg <[EMAIL PROTECTED]> writes:
I don't think it has anything to do with variable leaking out of the
loop. Common Lisp doesn't leak the loop variable, and it behaves the
same. It is more a result of the different views of what iteration
is. Common Lisp and Python define iteration in terms of repeating the
same instructions over and over, not different from what C does, in
which case it makes sense to reuse the same environment for all loop
passes. (Python's language ref defines that a standard "assignment"
is done for each new iteration.) In contrast, Scheme regards
iteration as a special case of recursion,
Whereas I regard iteration as 'within-namespace recursion' ;-)
which amounts to what Python, etc, do.
--
http://mail.python.org/mailman/listinfo/python-list