[Python-ideas] pep 312 - implicit lambdas idea
Bruce Leban
bruce at leapyear.org
Sat Aug 8 08:55:43 CEST 2009
I notice you said "args" not "arg". How would you parse foo(x, y -> x + y)?
Even if the compiler can parse it, how about the human reading the code?
If lambda wasn't already there, I could see using (args) -> expr syntax but
I think there shouldn't be two ways to do something so simple.
If you really want a shorter syntax, the obvious choice is foo(λx, y: x +
y).
--- Bruce
On Fri, Aug 7, 2009 at 5:49 PM, Greg Ewing <greg.ewing at canterbury.ac.nz>wrote:
> My suggestion for a lightweight lambda syntax is
>
> args -> expr
>
> Examples:
>
> map(x -> x + 5, something)
>
> d = defauldict(->[])
>
> --
> Greg
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20090807/e78990dd/attachment.html>
More information about the Python-ideas
mailing list