Re: About the native-lambda branch

2018-01-13 Thread Daniel.Sun
It seems that I found where go wrong. The shared local variables in generated method body should have been replaced with parameters. Let me try later :-) Cheers, Daniel.Sun -- Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html

Re: About the native-lambda branch

2018-01-13 Thread Daniel Sun
Hi Jochen, > What I wish for in a static compile lambda is the following: > * bar is a parameter to the method generated for the lambda I am trying to make native lambda support sharing local variables, but ASM reports the following error[1]: Caused by: java.lang.ArrayIndexOutOfBoundsException:

Re: Making @Immutable a meta-annotation

2018-01-13 Thread MG
Hi Paul, now I get where you are coming from with @KnownImmutable. I agree with splitting the two concepts: Flexible & elegant :-) Transferring the parameter name knownImmutables (which exists inside the @Immutable context) to the annotation name KnownImmutable (which has no such context)

Re: About the native-lambda branch

2018-01-13 Thread Jochen Theodorou
On 13.01.2018 04:07, Nathan Harvey wrote: Sure thing. Here's a Java example: void sample(Function fn) { System.out.println("fn"); } void sample(Supplier sp) { System.out.println("sp"); } These methods can exist side

Re: About the native-lambda branch

2018-01-13 Thread Daniel Sun
Hi Jochen, Here is an example: ``` import java.util.stream.Collectors; import java.util.stream.Stream; public class Test1 { public static void main(String[] args) { p(); } public static void p() { Stream.of(1, 2, 3).map(e -> e +