Functional programming
Marko Rauhamaa
marko at pacujo.net
Tue Mar 4 19:11:05 EST 2014
Gregory Ewing <greg.ewing at canterbury.ac.nz>:
> Marko Rauhamaa wrote:
>> Python doesn't have anonymous inner classes, but it has named inner
>> classes, and that's quite sufficient.
>
> I would say it's Python's closures that make up for not having Java's
> inner classes.
>
> Or to put it another way, inner classes are Java's kludgy way of
> working around a lack of closures.
I actually quite like Java's inner classes. In fact, I think introducing
lambdas into Java was a grave mistake; the silly competitive pressure
from C# made them accept a very ugly and disheveled syntax.
Inner classes *are* closures. They are more general than (Lisp-style)
lambda's because they accept more than one method.
Python, of course, has all of the above.
Marko
More information about the Python-list
mailing list