Re:Printf(“%s %s”, dependency, injection)
by mishafb on Tuesday October 19, 2021 @06:11AM
(#28916554)
The lambdas aren't actually lambdas, they are anonymous classes with a single metthod according to the type-inferred interface, and they can't use variables that aren't effectively final.
[ Parent
| on HN ]
Re:Printf(“%s %s”, dependency, injection)
by gpderetta on Tuesday October 19, 2021 @06:20AM
(#28916611)
That's just a way to make them work in the existing ecosystem (in C++ lambdas for example are just function objects with overloaded operator()).
The final is to avoid some mistakes, but they are still effectively closures.