I sing the praises of lambda, my friend and savior!
Jeff Shannon
jeff at ccvcorp.com
Tue Oct 12 14:01:06 EDT 2004
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. 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.
Jeff Shannon
Technician/Programmer
Credit International
More information about the Python-list
mailing list