groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From daniel_sun <>
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.


      Thanks for your reminding :)


View this message in context:
Sent from the Groovy Dev mailing list archive at

View raw message