groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Harvey <nathanwhar...@gmail.com>
Subject Resolving Closures as functional interfaces
Date Thu, 17 Aug 2017 06:39:14 GMT
Java 8 gave some good concrete types for functional programming, but Groovy
does not interlope well with these new types. Consider the following
methods:



And the following code:


It would seem obvious that this should reference the handle(Function) method
- it takes an argument and returns a value. However, it uses the
handle(Runnable) method. More examples of a breakdown, in terms of the most
logical resolution:



I have a sneaking suspicion that something on the parrot branch will have
this fixed. If not, how would this be fixed? It's my understanding that
methods are picked at runtime, so maybe a change to metaclass? I would love
some direction on this.

Thanks.



--
View this message in context: http://groovy.329449.n5.nabble.com/Resolving-Closures-as-functional-interfaces-tp5742621.html
Sent from the Groovy Dev mailing list archive at Nabble.com.

Mime
View raw message