Details
-
Type:
New Feature
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: syntax
-
Labels:None
-
Number of attachments :
Description
Consider supplying an "implies" operator, often denoted =>, for boolean expressions. Example:
if (itIsRaining => iAmUsingUmbrella) {
println 'I am dry'
}
itIsRaining => iAmUsingUmbrella is equivalent with !itIsRaining | iAmUsingUmbrella but the "implies" version is in many cases intutively more suitable.
Issue Links
| This issue relates to: | ||||
| GROOVY-2756 | create new user overwritable operator methods for <,==,>,<=,=>,<==> |
|
|
|
an alternative for a=>b would be !a?:b. Still not as nice of course