groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Theodorou <blackd...@gmx.org>
Subject Re: How to determine the equality of two closures?
Date Thu, 13 Apr 2017 15:38:46 GMT
Jason, have you ever trief something like this?

>  person.watch = { cond, action, elseAction ->
>    def value = person.with(cond).clone()
>    @groovy.transform.Field lastValue
>    if (value != lastValue) action(lastValue, value) else elseAction()
>    lastValue = value
>  }

bye Jochen

Mime
View raw message