[swift-evolution] Remove (!) logical negation operator
Al Skipp
al_skipp at fastmail.fm
Tue Dec 15 12:25:17 CST 2015
> On 15 Dec 2015, at 18:14, Bruno Berisso via swift-evolution <swift-evolution at swift.org> wrote:
>
>
> > For example in `if let aBool = aBool where !aBool`, let's suppose that we know that `aBool` optional it's not empty before this check. How would you write it? `!aBool!` or with the `if let...` ?
>
> if aBool == false {} covers this nicely.
>
> I think it will be `if aBool! == false {} ` to match the case in my previous example (not the !) (and note that I need to note the ! :) )
Don’t forget it’s perfectly fine to compare an Optional to a non-optional value with ==, the ! isn’t required and is potentially explosive.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151215/0c12c723/attachment.html>
More information about the swift-evolution
mailing list