2 ms·
"Lambda functions are just syntax, they aren't "flexible" in any meaningful way I can see" I disagree with that statement. To the best of my knowledge, lambdas
by pmelendez 14y ago
"Lambda functions are just syntax, they aren't "flexible" in any meaningful way I can see"
I disagree with that statement. To the best of my knowledge, lambdas functions are implemented as functors which are created by the compiler. So to have a comparable code you have to create those functors by hand. Which can be a lot of repetitive and boring work if you are doing something like an event system.
"virtually all major languages (other than C and C++03) have some form of straightforward anonymous function"
What about Java? :)
"virtually none of them make regular use of them. When they do, it's mostly just to have a convenient way of passing a callback."
Coming from Scheme (which yeah we can argue whether is a major language or not) I can see a lot of benefits of using closures, way more than just a convenient way to pass a callback.
"Lambda's are good. But as implemented in C++11 they really don't do anything to change the nature of the code being written."
Even when is not as powerful as the implementation in other languages still is a huge gain rather not having them at all. If you use them accordingly you would found a more concise and clear code in comparison with not using them. At least that was my personal experience.