Re:The Groovy project is looking for a new home
by nimblegorilla on Monday January 19, 2015 @09:48PM
(#8915216)
It's subtle, but I think the difference is that in ruby when potentially_falsy_value is false you will get the safeDefault. But with ?: you would get the potentiallyFalsyValue as false. The only time you get safeDefault is when potentiallyFalsyValue is nil/null
[ Parent
| on HN ]
Re:The Groovy project is looking for a new home
by prophetjohn on Wednesday January 21, 2015 @08:19PM
(#8926932)
The docs seem to state otherwise
One instance of where this is handy is for
returning a 'sensible default' value if an
expression resolves to false or null
http://groovy.codehaus.org/Operators#Operators-ElvisOperator(?:)