I sing the praises of lambda, my friend and savior!

Ville Vainio ville at spammers.com
Mon Oct 11 14:03:22 EDT 2004


>>>>> "Clark" == Clark C Evans <cce at clarkevans.com> writes:

    Clark> def somerandomname(args):
    Clark>     body
    Clark> func(arg, somerandomname)

    Clark> So, you've taken something that is a perfectly clear
    Clark> one-liner and converted it into a 3 line chunk of code with
    Clark> _zero_ added clarity, in fact, I'd say you've dramatically
    Clark> reduced clarity by requiring the a name be 'minted'.  Ugly.

What does "minting" a name mean?

You can always do

def L(args): body

func(arg, L)

You can even make it a habit to always call it L.

    Clark> Expect me to whine very loudly on a daily basis when Python
    Clark> 3000 becomes near.  In fact, let the preemptive
    Clark> supplication begin.

Heh, I can already anticipate the whining around py3000. It will
probably be a test bed for hundreds of new voting methods and give
sociology students thesis-fodder for years.

    Clark> Ewww.  How is this better than lambda? Let's keep lambda,
    Clark> no?

I agree. Lambda doesn't suck anymore, so it deserves to live. 

-- 
Ville Vainio   http://tinyurl.com/2prnb



More information about the Python-list mailing list