Hi Daniel,

I just built from sources and ran my usual smoke test (hello world style),
and all was fine.
But I haven't tested your native lambda work, sorry (I'm sick & travelling
at the same time, so don't have much time for now)

+1

Guillaume


On Fri, Mar 2, 2018 at 6:01 PM, Daniel.Sun <sun...@apache.org> wrote:

> If you are using Java8 and want to try the native lambda, please add
> addition
> JVM options( `-Dgroovy.target.bytecode=1.7 -Dgroovy.antlr4=true` OR
> -Dgroovy.target.bytecode=1.8 -Dgroovy.antlr4=true)
>
> For example:
> 1) Run script via command line
> ```
> groovy -Dgroovy.target.bytecode=1.8 -Dgroovy.antlr4=true
> TryNativeLambda.groovy
> ```
>
> 2)  Run script in groovy console
>          a) set the environment variable `JAVA_OPTS` as
> `-Dgroovy.target.bytecode=1.8 -Dgroovy.antlr4=true`
>          b) run `groovyConsole`
>
>
> Here is a sample script for you to try:
> ```
>        import groovy.transform.CompileStatic
>         import java.util.stream.Collectors
>         import java.util.stream.Stream
>
>         @CompileStatic
>         public class Test1 {
>             public static void main(String[] args) {
>                 p();
>             }
>
>             public static void p() {
>                 println([1, 2, 3].stream().map(e -> e.plus 1).toList())
>             }
>         }
> ```
>
>        In next releases of 2.6.0, `-Dgroovy.target.bytecode=1.7` will be
> set
> by default.
>
> Cheers,
> Daniel.Sun
>
>
>
> --
> Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html
>



-- 
Guillaume Laforge
Apache Groovy committer & PMC Vice-President
Developer Advocate @ Google Cloud Platform

Blog: http://glaforge.appspot.com/
Social: @glaforge <http://twitter.com/glaforge> / Google+
<https://plus.google.com/u/0/114130972232398734985/posts>

Reply via email to