Let's Talk About Lambda Functions!

Britt A. Green shecky at experimentzero.org
Fri Jul 26 15:52:38 EDT 2002


I guess that begs the question: what's the advantage of functional-style
programming? :)

--
"My mom says I'm cool."

----- Original Message -----
From: "Chris Liechti" <cliechti at gmx.net>
Newsgroups: comp.lang.python
To: <python-list at python.org>
Sent: Friday, July 26, 2002 11:44 AM
Subject: Re: Let's Talk About Lambda Functions!


> "Britt A. Green" <python at experimentzero.org> wrote in
> news:mailman.1027705851.8443.python-list at python.org:
>
> > So I know what lambda functions are, they're syntax and how they're
used.
> > However I'm not sure *why* one would use a lambda function.
>
> Guido may have asked himself similar questions, considering the note on
the
> OSCON and EuroPython slides ;-)
>
> > What's the
> > advantage that they offer over a regular function?
>
> you can define a lambda in an expression, while a "def" is a statement.
> and that's probably all there it is. (lambdas have some constraints as
they
> can only be expressions, but thats a detail)
>
> cause' lambdas are expresions, they are useful when writing functional
> style programs.
>
> map(lambda x,y:x+y, range(3), [7,8,5])
>
> chris
> --
> Chris <cliechti at gmx.net>
>
>





More information about the Python-list mailing list