Reputation: 2281
I'm obviously doing it wrong but isn't it possible for callPrint() to use the return value from the closure? How can I correctly pass the return value of a Closure into a method?
void callPrint(def num){
println "${num}";
}
callPrint{return 5}; //does not print
Thanks.
Regards, John
Upvotes: 2
Views: 3803