Inconsistent conditionals: if !a?
, unless a?
, when a?
, when !a?
#2567
Labels
if !a?
, unless a?
, when a?
, when !a?
#2567
First of all, I did search Issues. I found current implementation of conditionals quite crappy when it comes to total negation.
One concrete example:
compiles to
I believe that all should compile into the simplified boolean expression form(i.e.
a==null
ora!=null
). This is no C++ where operators might be overloaded and no longer form boolean algebra. As long as boolean algebra holds, nothing could prevent us to do these fundamental reductions.Unless... someone name me a corner case where
!(a!=null)
anda==null
turns out different? I don't remember any, but either way!!(a!=null)
is meaningless as(a!=null)
is already boolean.The text was updated successfully, but these errors were encountered: