functional programming

Justin Sheehy dworkin at ccs.neu.edu
Tue Feb 22 23:54:30 EST 2000


"Michal Wallace (sabren)" <sabren at manifestation.com> writes:

> Aahz posted a recursive version of a fib() routine. Is this
> not what you'd want? What would fib() look like in one of the
> functional languages you're used to?

The function Aahz posted looks much like the immediately intuitive
version of the same function in most functional languages.  However,
that is far from the most efficient way to compute fibonacci
sequences, and you would probably optimize a program in a functional
language quite differently than a program in Python.

Contrary to what someone wrote earlier, you most certainly _can_
program functionally in Python.  It just isn't easy.  Also, typical
functional idioms tend to be painfully inefficient in Python.  Viper
addresses some of the implementation issues that make this so, but the
core Python implementation probably never will.

-Justin

 




More information about the Python-list mailing list