lambda closure question
Diez B. Roggisch
deetsNOSPAM at web.de
Mon Feb 21 10:16:13 EST 2005
Paul Rubin wrote:
> "Diez B. Roggisch" <deetsNOSPAM at web.de> writes:
>> It's not only that way in python, but in java too. So it seems that there
>> is a fundamental principle behind it: In a language that allows
>> sideeffects, these will actually happen.
>
> Can you even have nested functions in Java? Algol-60 did things the
> way you'd expect, i.e. you can modify the outer variable from the
> inner scope.
Not nested functions, but closures in anonymous inner classes - which can
reference only final variables, thus creating the same effect as the
scoping rules of python.
--
Regards,
Diez B. Roggisch
More information about the Python-list
mailing list