Procedural macros for closures with shorthand argument names (like in Swift)
Without arguments (not useful):
let _ = Some("foo").ok_or_else(l!(0));
// expanded:
let _ = Some("foo").ok_or_else(|| 0);
With one explicit argument:
let _ = Some(3).filter(l!($0 % 2 == 0));
// expanded:
let _ = Some(3).filter(|_0| _0 % 2 == 0);
With two explicit arguments:
let _ = [1, 2, 3].iter().fold(0, l!($0 + $1));
// expanded:
let _ = [1, 2, 3].iter().fold(0, |_0, _1| _0 + _1);
With one explicit, one implicit arguments:
let _ = [1, 2, 3].iter().fold(0, l!($1 + 1));
// expanded:
let _ = [1, 2, 3].iter().fold(0, |_, _1| _1 + 1);
etc.
Limitation: the last argument must be explicit.