[Python-ideas] Ruby-style Blocks in Python Idea

Guido van Rossum guido at python.org
Tue Mar 10 19:47:21 CET 2009


On Tue, Mar 10, 2009 at 11:38 AM, spir <denis.spir at free.fr> wrote:
> Le Tue, 10 Mar 2009 10:05:30 -0700,
> Guido van Rossum <guido at python.org> s'exprima ainsi:
>
>> On Tue, Mar 10, 2009 at 1:19 AM, spir <denis.spir at free.fr> wrote:
>> > I do not agree with that. It is missing the point of lambdas. Lambdas are
>> > snippets of code equivalent to expressions to be used in place. Lambdas
>> > are *not* called, need not beeing callable, rather they are *used* by
>> > higher order functions like map. The fact that they do not have any name
>> > in syntax thus properly matches their semantic "anonymousity" ;-)
>>
>> Eh? On what planet do you live? What use is a lambda if it is never
>> called? It will *eventually* be called -- if it is never called you
>> might as well substitute None and your program would run the same.
>>
>
> Should have written: "called in code" (!). Thought it was obvious, sorry. It's executed indeed through the func it is passed to, but not (explicitely) called. The point I meant is: it is locally used -- not called from anywhere else -- the reason why it needs no name.

OK, I understand what you're saying now. But I don't agree with your
position that if it isn't used locally it doesn't deserve a name.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-ideas mailing list