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

Antoon Pardon apardon at forel.vub.ac.be
Wed Oct 13 03:20:33 EDT 2004


Op 2004-10-12, Jeff Shannon schreef <jeff at ccvcorp.com>:
> Antoon Pardon wrote:
>
>>Op 2004-10-11, Jeff Shannon schreef <jeff at ccvcorp.com>:
>>  
>>
>>>Lambdas are hard to read, because they're significantly different, 
>>>syntactically, from any other construct in the language
>>>    
>>>
>>
>>I didn't find them so. On the other hand I find having to come up
>>with a name for a function can be very inconvenient and not worth
>>the trouble. If python wants functions to be full fledged objects,
>>is needs some way to have unnamed functions, just as you can have
>>unnamed lists, numbers, instances etc.
>>
>>Can you imaging the protest, from people if it would be decide
>>that no unnamed entities van be used. If you want to use a number
>>or a list, as an argument you first have to name it and then use
>>the name as argument. Well the reason for having anonymous numbers
>>and lists is the same reason for having anonymous functions.
>>  
>>
>
> 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) 
> algorithm.

I find it better to let the coder decide what makes sense in his program
and what not.

> 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?

-- 
Antoon Pardon



More information about the Python-list mailing list