[swift-evolution] Proposal: x == 2 should not be a valid statement

jcr at mac.com jcr at mac.com
Thu Feb 11 18:05:05 CST 2016


> On Feb 11, 2016, at 3:59 PM, Jessy Catterwaul <mr.jessy at gmail.com> wrote:
> 
>> So, == gets replaced with six characters, plus a special case of “=“?
>> 
>> -1 from me.  Don’t like this idea at all.
> 
> Fair enough. How about “is”?
> 
> {x is 2}

I’d say that “is” is more appropriate for replacing the identity operator “===“.   If we did that though, we’d have to also have “isn’t” or “!is” in our code.

“==“ for equivalence isn’t broken.   It doesn’t need fixing.

-jcr



More information about the swift-evolution mailing list