"Barry A. Warsaw" <bwarsaw(a)cnri.reston.va.us> writes:
Hrvoje> Python is very cool. It's a shame it doesn't
have lexical
Hrvoje> closures, though. Even the four-letter-P-word "language"
Hrvoje> has them.
Sorry, I don't know what that last bit means... :-)
{
my $foo = 3;
sub bar { $foo; }
}
# $foo no longer in scope
print &bar ();
Can I do that in Python? These things are very important in some
cases, especially with anonymous functions ("closures") used as
callbacks to widget functions.
The standard Python response is "use a class".
Awww...