[Haskell-cafe] re: Python

Jerzy Karczmarczuk karczma at info.unicaen.fr
Tue May 31 07:14:05 EDT 2005


Stijn De Saeger wrote:

>>On 27/05/05, John Goerzen <jgoerzen at complete.org> wrote:
>>    
>>
>>>Yes, but actually much of that is slated for removal from the Python
>>>language in future versions.  See
>>>
>>>http://www.python.org/peps/pep-3000.html
>>>      
>>>
>>I still can't believe that Guido will get away with this...
>>    
>>
>
>Yes. Many people I know state the functional part as a big reason why
>they chose python.
>Basically, before Python 3000 a number of scenarios are thinkable :
>- The python community will just bite their lip and take it. 
>- There'll be some skirmishes and the proposal will get shot down
>after a small revolution. (not likely)
>- python will get a second -- more functional -- branch coexisting
>with the standard.
>  
>

Please read Douglas Adams' books (Hitchhiker Guide, etc.)

AND DON'T PANIC.

The perspectives are not so bad.

Lambda goes to limbo? So, you will define local NAMED functions.
Ideologically you may not like it, but you won't lose much. Those
lambdas in Python were handicapped anyway.

Map and filter removed?
List comprehensions are still there, and they do all you want.
Here the only 'functionalism' which disappears is 'reduce()',
our beloved fold. It can be reinstated as a library function implemented
as loop.

Some 'functional' attributes of the language get stronger.
No more print statement, but a 'function' write.
Idem for 'exec'.

Higher-order "vision" of the language gets a new impact. Now
'range' will return an *iterator* .

Plenty of standard iterations may profit from *generators*.
While not reall 'functional', this contraption promotes the
declarative programming (Prolog, Icon, etc.).

There are more annoying things. No tail recursion optimization.
Horrible difference in efficiency between some "standard"
procedures such as sorting which uses built-in order, and
user-defined one. Etc.

Jerzy Karczmarczuk





More information about the Haskell-Cafe mailing list