Lambda again: unnamed arguments

March 27, 2008
11:25 a.m.
Hello, inspired by Greg's post about ideas on making the lambda syntax more concise, like: x,y => x+y I was wondering if using unnamed arguments had already been debated. Something like: \(_1+_2) where basically you're declaring implicitally declaring that your lambda takes two arguments. You wouldn't be able to call them through keyword arguments, nor to accept a variable number of arguments (nor to accept more arguments than they are actually used), but wouldn't it cover most use cases and be really compact? Other examples: k.sort(key=\(_1.foo)) k.sort(key=\(_1[0])) -- Giovanni Bajo
6178
Age (days ago)
6178
Last active (days ago)
1 comments
2 participants
participants (2)
-
Brett Cannon
-
Giovanni Bajo