can Python be useful as functional?

Neil Cerutti horpner at yahoo.com
Tue Sep 18 08:17:29 EDT 2007


On 2007-09-18, Kay Schluehr <kay.schluehr at gmx.net> wrote:
> On 18 Sep., 10:13, Bruno Desthuilliers <bruno.
> 42.desthuilli... at wtf.websiteburo.oops.com> wrote:
>> Lorenzo Stella a écrit :
>>
>> > Hi all,
>> > I haven't experienced functional programming very much, but now I'm
>> > trying to learn Haskell and I've learned that: 1) in functional
>> > programming LISTS are fundmental;
>>
>> Not exactly. They are used quite a lot, yes, but that's also
>> the case in other paradigms. What's important in functional
>> programming is *functions*.
>
> Functional lists are not quite the same. They are actually
> recursive datastructes. In Python you would model them as
> nested tuples:
>
> t = (a, (b, (c, ...(d, None)))))

Tuples won't work for cyclic data, though.

-- 
Neil Cerutti



More information about the Python-list mailing list