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

Jeff Shannon jeff at ccvcorp.com
Wed Oct 13 19:58:14 CEST 2004

Antoon Pardon wrote:

>Op 2004-10-12, Jeff Shannon schreef <jeff at ccvcorp.com>:
>>Functions are at a different level of granularity than numbers and 
>>lists.  Anonymity makes sense for numbers and lists; it makes less sense 
>>for collections of numbers and lists; and it makes still less sense for 
>>organized collections of numbers, lists, and operations thereon, which 
>>are structured in a meaningful way to express some (part of an) 
>I find it better to let the coder decide what makes sense in his program
>and what not.

Which is the Perl philosophy.  Many people seem quite happy with Perl 
because of this TMTOWTDI attitude; personally, I prefer Python's clarity 
and simplicity.

>>Similarly, I don't expect each line of code to have an 
>>individual name, but once I collect lines of code into a file, I 
>>certainly *do* expect to name that file, even if the file is only one or 
>>two lines long.
>So? If you then want to develop the code, do you put the new code in a
>new file and then use a program to include it, or do you put unnamed
>text in the already existing file?

Actually, I effectively do both of those, depending on circumstances.  
(Opening a new editor, typing in it, and then pasting that text into the 
middle of an existing file.)  However, in this (admittedly weak, 
especially when pushed this far) analogy, a lambda is equivalent to 
putting the text in a new file, and insisting that that file not be 
given a name and be kept separate from the parent file, but be 
programmatically included nonetheless.  Would you *want* to do that, 
even if your operating system allowed it?

Jeff Shannon
Credit International

More information about the Python-list mailing list