can Python be useful as functional?
Kay Schluehr
kay.schluehr at gmx.net
Tue Sep 18 02:33:37 EDT 2007
On 18 Sep., 03:30, "Evan Klitzke" <e... at yelp.com> wrote:
> > My question is: how can we call a language "functional" if it's major
> > implementation has a limited stack? Or is my code wrong?
>
> Python does not optimize tail recursion.
Never mind. In the provided example the call to sieve() is not in tail
position anyway ;)
[...]
> If you
> want to write functional code, use a real functional language!
It's hard to disagree. As a Python programmer I'd rather care for
smooth integration with code written in Haskell or OCaml than adopting
their particular programming idioms. For instance the Python - OCaml
bridge is aged and I'm not aware that one between Python and Haskell
even exists.
More information about the Python-list
mailing list