In article ,
namekuseijin wrote:
>
>I don't like *for* at all. It both makes it tough to get true closures
>and also unnecessarily pollutes the namespace with non-local variables.
Maybe. Consider this standard Python idiom:
for x in L:
if x == criterion:
break
doSomething(x)
Obv
The real issue here has nothing to do with closures, lexical capture or
anything like that. It's a long known issue called side-effects.
Trying to program in a functional style in the presence of side-effects
is bad. *for* is the main perpetrator of side-effects here, because it
updates its