functional programming

François Pinard pinard at iro.umontreal.ca
Tue Feb 22 10:12:36 EST 2000


Moshe Zadka <moshez at math.huji.ac.il> écrit:

> > using Python.My guess is that I would have no problem naming my lambda's
> > (using `def'), and approximating lexical closures (using `class').
> > 
> > Maybe we should not get distracted that much by syntactical sugar! :-)

> You can't do serious functional programming without tail recursion.

I could iterate explicitly and easily, which is not a bad thing anyway.
Tail recursion is good for many things, it can be used to hint optimising
compilers, yet past a certain point, we start loosing legibility.

For me, functional programming is a way of writing algorithms in which
you have an important stress on functions as primary objects, dynamically
building functions from more elementary ones, inter-relating functions,
and often using them to represent partial solutions.

It is not defined as abusing of function calls, or avoiding assignment
or iteration.  I may be all wrong, but I think functional programming is
more an approach to solving problems, than a code writing style.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard






More information about the Python-list mailing list