Fate of lambda, Functional Programming in Python...

Marek Baczyński imbaczek-nospam at poczta.fm.cut-from-here.no-spam.info
Fri Aug 20 17:26:50 EDT 2004


Dnia Fri, 20 Aug 2004 22:37:07 +0200, Reinhold Birkenfeld napisał(a):

> Jeff Sandys wrote:
>> I think that lambda should be unlimited and expanded.  It already has
>> the 
>> colon, block delimiter, so allow lambda to be a multistatement and
>> multiline
>> indented block!
> 
> So in what point exactly is this different from a def(), then?

1) Lambda is anonymous.
2) Lambda evaluates to a function (or rather can be used as an expression.)

Try this without lambda:

[lambda x, y: x+y, lambda x, y: x*y, ... (etc.)]

I don't say it's impossible, but largely superfluous. (Note that this
*particular* case can be (better) solved by operator.*.)

-- 
Marek Baczyński :: UIN 57114871 :: GG 161671 :: JID imbaczek at jabber.gda.pl
He who knows best best knows how little he knows. -- Thomas Jefferson



More information about the Python-list mailing list