groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From daniel_sun <realblue...@hotmail.com>
Subject Re: Lambda expression for Groovy 3
Date Wed, 19 Oct 2016 11:10:07 GMT
Hi Jesper,

> Be careful with that approach, as it won’t work for static methods —
> leading to very different semantics for the two languages. 
      '.&' can reference the static methods, here is the sample code:

                       [1, 2, 3].each(Objects.&requireNonNull)

>  Also, you won’t be able to support constructor references without some
> new AST construct, I guess. 
      As you said, '.&' does not support constructors..., the following code
is valid in Java, but I have no idea the equivalent in Groovy.

                       GenericsType[]::new

      Thanks for your reminding :)

Cheers,
Daniel.Sun



--
View this message in context: http://groovy.329449.n5.nabble.com/Lambda-expression-for-Groovy-3-tp5736169p5736201.html
Sent from the Groovy Dev mailing list archive at Nabble.com.

Mime
View raw message