With regards to Groovy 3.0 Java lambda support: Is it practically doable to
turn a Groovy closure into a Groovy Java lambda if only effectively final
variables are used inside the closure ? And if yes, might that be a future
Groovy feature ?
I am asking because otherwise there will exist two quite differen anonymous
function syntax varieties in Groovy, with both most likely being in active use,
instead of one just existing for Java syntax compatibility reasons. Which of
course works, but feels a bit messy / un-Groovy, and also can lead to code
being executed slower than possible, if someone uses Groovy closure syntax
everywhere.
Or would "closure inlining" support be the better approach here (also with
regard to implementation effort), since turning e.g. a forEach + cls expression
into a for-loop with the cls inlined as a block should be even faster than
using a Java lambda ?
Cheers,mg