Let's Talk About Lambda Functions!

John Roth johnroth at ameritech.net
Sun Jul 28 07:49:58 EDT 2002


"Fredrik Lundh" <fredrik at pythonware.com> wrote in message
news:NuN09.1347$HY3.367000 at newsc.telia.net...
> Bryan Olson wrote:
>
> > The mistake was limiting lambda to expressions.
>
> Guido can channel himself (or Tim will do it), but from what
> I can tell, he's always said that the "mistake" was adding
> something to the language that almost, but not completely,
> works like lambdas do in other languages.
>
> (lambda, map, filter, etc was contributed code)
>
> the really big usage problem (whether you knew lambdas
> from other languages or not) used to be that they were a
> real pain to use under the LGB scoping rule.  with the intro-
> duction of nested scopes, that problem no longer exists.
>
> to fix the other "mistake", some needs to come up with a
> really great syntax (and get michael hudson to implement
> it for them ;-).  ideas are welcome.

What's the problem with that? If we give up the notion
that anonamous functions need to look like expressions,
it should be simple. Just stick the function definition inline,
indentation and all. The only issue is defining a new keyword,
since lambda doesn't work that way. "def" would probably
work, since it's only allowed at statement level now.

John Roth
>
> </F>
>
>





More information about the Python-list mailing list