Ruby and Python

graham graham73 at telocity.com
Sun Nov 19 15:04:05 EST 2000


Alex Martelli
> [on functions]
> They're treated exactly like every other object, and thus
> are first-class.

It's fine if you want to go on believing that Python has first class
functions, but the fact that you have to manually form closures for
functions means that they are not first class in the accepted (and
admittedly informal) definition of "first class". Ocaml, Haskell, etc
all have first class functions in the accepted meaning.

I am not criticising Python on this issue. All I am saying is that
to go around saying Python has first class functions is misleading,
particulary when comparing Python with other languagees, as the
original author did with Ruby. If you want to say that "Python has
first class functions, except that you have to manually form closures",
that's fine, but that's not the same as "having first class functions".

graham




More information about the Python-list mailing list