Of what use is 'lambda'???

Grant Edwards ge at nowhere.none
Tue Sep 19 16:57:22 EDT 2000


In article <wkem2g7ag0.fsf at turangalila.harmonixmusic.com>, Dan Schmidt wrote:
>jonadab at bright.net (Jonadab the Unsightly One) writes:
>
>| OTOH, I seldom use lambda in elisp, either.  It just
>| seems...  unnecessary.
>
>I use it all the time, generally in two cases:
>
> - as an argument to mapcar (analogous to a map/lambda in Python)
> - when I'm adding a hook and don't want to bother naming it.

I use lambda quite a bit in both Python and Scheme: in the same
places in both:

 1) to create a function to be passed to map/filter/reduce
 
 2) to create functions to hook to GUI widgets (esp. e.g. in a
    loop).

Thinking up good names for things is the hardest part of
writing a program.  Why bother naming something you don't have
to?

-- 
Grant Edwards                   grante             Yow!  HOORAY, Ronald!! Now
                                  at               YOU can marry LINDA
                               visi.com            RONSTADT too!!



More information about the Python-list mailing list