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 10:23:09 GMT
Hi Jochen,

      I plan to map Java's *::* to Groovy's *.&*, the following code is ok
now. What do you think about it?

[1, 2, 3].stream().forEach(System.out.&println)          // object method,
[1, 2, 3].stream().forEach(System.out::println) 
[1, 2, 3].stream().forEach(Objects.&requireNonNull) // class method,  [1, 2,
3].stream().forEach(Objects::requireNonNull)

Cheers,
Daniel.Sun



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

Mime
View raw message