groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Theodorou <blackd...@gmx.org>
Subject Re: 答复: 答复: About the "implies" operator(GROOVY-2576)
Date Thu, 26 Jan 2017 11:21:55 GMT


On 26.01.2017 12:04, Cédric Champeau wrote:
> So I used IntelliJ's awesome structural search to find this pattern in
> the Gradle codebase:
>
> !$a$ || $b$
>
> It returns 41 matches, for a total of 49807 source files. FWIW

!a||b becomes a=>b
a||b becomes !a=>b
a||!b becomes !a=>!b
!a||!b becomes a=>!b

And since !a||b is the same as a&&!b

a&&b becomes a=>!b
a&&!b becomes a=>b
!a&&b becomes !a=>!b
!a&&!b becomes !a=>b

In Closure.java we have for example this condition: (secondTry!=null && 
firstTry!=this && firstTry!=secondTry

we could write that for example as

secondTry==null => (firstTry==this || firstTry==secondTry)

(secondTry!=null && firstTry!=this) => firstTry==secondTry

secondTry!=null => firstTry==this => firstTry==secondTry


bye Jochen

Mime
View raw message