In python the following statement returns correct results:
>>> 1 == 1 == 1
True
>>> 1 == 1 == 0
False
Is such construct (or similar) possible in groovy? The following fails:
groovy:000> 1 == 1 == 1
===> false
since the first comparison is evaluated to true
and true
is not equal to 1
. Any workaround on this?
A workaround would be using AST transformations of course: http://docs.groovy-lang.org/docs/next/html/documentation/core-metaprogramming.html#developing-ast-xforms