A critic of Guido's blog on Python's lambda
brian at sweetapp.com
brian at sweetapp.com
Sun May 7 06:10:26 EDT 2006
Patrick May wrote:
> aleaxit at yahoo.com (Alex Martelli) writes:
>> In my opinion (and that of several others), the best way for Python to
>> grow in this regard would be to _lose_ lambda altogether, since named
>> functions are preferable
>
> Why? I find the ability to create unnamed functions on the fly
> to be a significant benefit when coding in Common Lisp.
1. They don't add anything new to the language semantically i.e. you
can always used a named function to accomplish the same task
as an unnamed one.
2. Giving a function a name acts as documentation (and a named
function is more likely to be explicitly documented than an unnamed
one). This argument is pragmatic rather than theoretical.
3. It adds another construction to the language.
Cheers,
Brian
More information about the Python-list
mailing list