groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Dorner <felix.dor...@gmail.com>
Subject Re: Aw: Do closures always return a value?
Date Fri, 04 Dec 2015 11:44:26 GMT
Hi,

On 04-Dec-15 12:23, Alessio Stalla wrote:
> [..] use a different
> sentinel value to indicate pruning, like a public static Object PRUNE =
> new Object(); somewhere. Then, the each method does not do if(closure())
> it.prune() but if(PRUNE == closure()) it.prune().

I like this. Thank you :)

Mime
View raw message