
Aug. 8, 2009
8:55 a.m.
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@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@python.org http://mail.python.org/mailman/listinfo/python-ideas