can Python be useful as functional?
Bruno Desthuilliers
bruno.42.desthuilliers at wtf.websiteburo.oops.com
Tue Sep 18 08:28:30 EDT 2007
Kay Schluehr a écrit :
> 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.
Linked lists, most of the time, yes.
(snip)
> In order to access an element you already need a recursive function
> defintion ( unless you just want to examine the head or the tail
> only ) and this makes functional programming and "consed" lists a
> perfect match.
Indeed. And that's also why some FP idioms don't translate directly in
Python.
> [...]
>
>> Strictly speaking, a language is functional if it has functions as first
>> class objects. Period.
>
> No, not period and not strictly speaking.
Ok, even on c.l.functional - where the above definition comes from BTW
-, nobody really agree on the "correct" definition of functional !-)
More information about the Python-list
mailing list