In case there are any C++ programmers reading this: https://old.reddit.com/r/cpp/comments/esevzz/how_about_a_much_simpler_c_abbreviated_lambda/?st=k5pt52dr&sh=a2663442
Some thoughts about a possible lambda shorthand. Basically, I want `[](auto foo) => foo.bar < 10`.
@mort I don't see a point in getting rid of curly braces, since if your lambda is not the last argument, you'll have to wrap the whole thing in parens (cause comma operator), which is even worse, but I agree that the return and the extra semi colon are painful sometimes. Maybe something like [] () -> (expr) could work? As far as I know the type after arrow can't start with a paren, so it's not ambiguous.
@mort I see, I guess it's not really a problem with function parameters, but it feels like there are going to be edge cases where it could behave unexpectedly.
That said it could be that I just don't like what javascript does. In that log example I'm inclined to pivot on => and group everything on either side of it together.
foo([](a,b) => a + bar(a, b), c) // kind of blends together
vs
foo([](a,b) -> (a + bar(a, b)), c) // c looks more isolated