Re: Fate of lambda, Functional Programming in Python...

From: Peter Kleiweg (in.aqua.scribis_at_nl.invalid)
Date: 08/20/04


Date: Fri, 20 Aug 2004 23:23:32 +0200

Anthony Baxter schreef:

> On Fri, 20 Aug 2004 12:50:02 -0400, Chas Emerick <cemerick@snowtide.com> wrote:
> > In a comment off a post on lambda-the-ultimate, I noticed this little
> > offhand remark:
> >
> > '''IIRC GvR is going to kill the various lambda, map,filter & reduce
> > leaving just generator expressions/list comprehension.'''
>
> First point: lambda, map, filter and reduce won't go away before Python 3.0,
> at the very least. And, to be honest, I suspect map/filter/reduce are much more
> likely to die than lambda, as they can nearly always be expressed more clearly
> as listcomps or genexprs.

The Python Cookbook, recipe 1.8, "Finding the Intersection of
Two Dictionaries" shows different methods of doing this
particular thing, among them list comprehension and filter.
Here, using filter is the fastest of all.

Why would you want to do away with something that is useful?

> Having said that, and donning my interpreting-Guido-hat, the major problem
> with lambda is the scoping issue. Nested scopes make this less of a problem.
> In addition, the name 'lambda' was a poor poor choice.

The choice is perfectly logical.

-- 
Peter Kleiweg  L:NL,af,da,de,en,ia,nds,no,sv,(fr,it)  S:NL,de,en,(da,ia)
info: http://www.let.rug.nl/~kleiweg/ls.html
The Halloween Documents: http://www.opensource.org/halloween/


Relevant Pages

  • Re: Python becoming less Lisp-like
    ... >Basically, it says that it will get rid of the explicit map, filter ... >It will also get rid of lambda, and it's not a great loss, since ... For a while it covered some Python ...
    (comp.lang.python)
  • Re: Python becoming less Lisp-like
    ... >Basically, it says that it will get rid of the explicit map, filter ... >It will also get rid of lambda, and it's not a great loss, since ... For a while it covered some Python ...
    (comp.lang.lisp)
  • Re: Python becoming less Lisp-like
    ... > Basically, it says that it will get rid of the explicit map, filter ... > It will also get rid of lambda, and it's not a great loss, since ... > The real problem with Python is that it has been very successful as a ...
    (comp.lang.lisp)
  • Re: Python becoming less Lisp-like
    ... > Basically, it says that it will get rid of the explicit map, filter ... > It will also get rid of lambda, and it's not a great loss, since ... > The real problem with Python is that it has been very successful as a ...
    (comp.lang.python)
  • Re: Fate of lambda, Functional Programming in Python...
    ... lambda, map, filter and reduce won't go away before Python 3.0, ... Having said that, and donning my interpreting-Guido-hat, the major problem ... the name 'lambda' was a poor poor choice. ...
    (comp.lang.python)