(changing the subject so we don't disrupt the main discussion)

Not quite 😔

The changes in Java to support Lambdas are much deeper than just how the Metafactory is invokedynamic'ed, as it changes how type inference and overload resolution is done. Same as with the issues we discussed a while back around method references: Supporting Java8 semantics in the Groovy compiler is a very big task, as we just don't have the type information available.

I would much rather suggest supporting the lambda syntax with groovy semantics, but add warnings if we detect that the code may rely on Java lambda semantics. For instance, we could warn the user if the lambda referred to 'this' or 'super' directly.

-Jesper

On 7 Feb 2017, at 16.00, Daniel Sun <realbluesun@hotmail.com> wrote:

Hi Jochen,

 

That’s great!

Paul and Graeme are both afraid of future breaking changes of groovy’s lambda expression, which is currently based on closure. If we could generate *real* lambda bytecode for LambdaExpression, groovy’s lambda expression will behave same with Java8’s at runtime😊

 

Cheers,

Daniel.Sun

 

发件人: [hidden email]
发送时间: 201727 22:23
收件人: [hidden email]
主题: Re: [VOTE] Apache Groovy Roadmap

 



On 07.02.2017 14:44, Daniel Sun wrote:
> Hi Cédric,
>
>       It seems that too many choices are a annoying problem, but I
> believe we can conquer it sooner or later ;)
>       BTW, is it possible to keep groovy' lambda expression as it
> is(i.e. groovy closure with lambda syntax) but generate *real* lambda
> bytecode for
> it(https://github.com/apache/groovy/blob/parrot/src/main/org/codehaus/groovy/ast/expr/LambdaExpression.java)?

sure, you should make a visitLambdaExpression similar to
visitClosureExpression and change our visitors

bye Jochen



If you reply to this email, your message will be added to the discussion below:
http://groovy.329449.n5.nabble.com/VOTE-Apache-Groovy-Roadmap-tp5738250p5738471.html
To unsubscribe from [VOTE] Apache Groovy Roadmap, click here.
NAML


View this message in context: 答复: [VOTE] Apache Groovy Roadmap
Sent from the Groovy Dev mailing list archive at Nabble.com.