<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Personally I really don’t mind ! for negation, but if it were to be removed the natural replacement would be ~. &nbsp;Boolean negation *is* bitwise negation, after all. &nbsp;!= would be spelled ~= a la Lua and MATLAB.</div><div class=""><br class=""></div><div class="">– Steve</div><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 15, 2015, at 1:45 PM, Paul Cantrell via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Though the “! means negation” operators are too widely used and too elegant for me to get behind this change, I would say a word in favor of Swift’s loose convention of “! means danger:”</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>! &nbsp;(force unwrap)</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>! &nbsp;(IUO)</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>as!</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>try!</div><div class=""><br class=""></div><div class="">…all mean “potential crash here.” That’s a nice convention.</div><div class=""><br class=""></div><div class="">However, because not all potential crash points are marked with ! (array subscripting, assert / precondition / fatalError, and of course any function that contains one of the above crashing constructs), we can’t say “danger implies !”. It thus doesn’t seem worth the pain of removing the !, != and !== operators to make the “! implies danger” association strong.</div><div class=""><br class=""></div><div class="">Still, I’d be in favor of anything that helps me audit code for potential crash points — if not changing the negation operators, then perhaps something AST based, perhaps even library annotations. At the very least, I’d appreciate it if SourceKit / Xcode could apply different syntax coloring to the negation bang and the danger bang.</div><div class=""><br class=""></div><div class="">Cheers,</div><div class=""><br class=""></div><div class="">Paul</div><div class=""><br class=""></div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Dec 15, 2015, at 12:26 PM, Craig Cruden via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">-1 as well.&nbsp;</span><div class="" style="font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""></div><div class="" style="font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">I cannot think of a language where I don’t have ! as negate (which I read as not).</div><div class="" style="font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""></div><div class="" style="font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">What would it be replaced by a keyword of “not”? &nbsp;</div><div class="" style="font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""></div><div class="" style="font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""><div class=""><br class=""></div><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 2015-12-16, at 1:18:14, Austin Zheng via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">-1. In terms of C features that people complain about, prefix '!' for negation doesn't seem to be high on the list, and it's never something that has caused me or any other developer I know a problem (although these are all anecdotes, take them as you will). A linter/style checker can always be used if you really want to enforce 'x == false' over '!x' for your team or project.<div class=""><br class=""></div><div class="">'~' is already used for bitwise negation.<br class=""><div class=""><div class=""><br class=""></div><div class="">More broadly, in terms of "words" vs "cryptic symbols" as operators, I am strongly against the former and for the latter. The symbols are 'cryptic' for the few minutes it takes to figure out what they mean, after which the developer is good for a lifetime of coding in many different languages. The words are nicely self-descriptive for a bit, then increase verbosity and destroy your ability to visually delineate arguments via symbols forever.</div><div class=""><br class=""></div><div class="">Best,</div><div class="">Austin</div><div class=""><br class=""></div></div></div></div><div class="gmail_extra" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""><div class="gmail_quote">On Tue, Dec 15, 2015 at 9:59 AM, ilya via swift-evolution<span class="Apple-converted-space">&nbsp;</span><span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span><span class="Apple-converted-space">&nbsp;</span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div class="" style="white-space: pre-wrap;"><span class="">&gt; 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...` ?<br class=""><br class=""></span>if aBool == false {} covers this nicely. <br class=""><br class="">As for the whole topic of words vs cryptic symbols for Boolean operators I'm agnostic on what's best but imho we need to have consistency. E.g. either all words, or all math symbols or all the same as in C (current state of things). <br class=""><br class="">You can always rewrite !x as (x==false) if x is a Bool and forced unwrapping is undesirable anyway so the confusion can be minimized in practice. <br class=""><br class="">Ilya. </div><br class=""><div class="gmail_quote"><div class=""><div class="h5"><div dir="ltr" class="">On Tue, Dec 15, 2015 at 19:56 Bruno Berisso via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""></div></div></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div class=""><div class="h5"><div dir="ltr" class="">I also hit the&nbsp;<b class="">!=</b>&nbsp;vs&nbsp;<b class="">&lt;&gt;</b>&nbsp;dilema and conclude that we could continue using the&nbsp;<b class="">!=</b>&nbsp;as "not equal".<div class=""><br class=""><div class="">It's true that it will not be as consistent as before but I think it's a reasonable price to pay taking into account the issues with&nbsp;<b class="">!</b>&nbsp;as 'not'.&nbsp;</div></div><div class="gmail_quote"></div></div><div dir="ltr" class=""><div class="gmail_quote"><div class="">&nbsp;</div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class=""><div class="">Not that I necessarily think this proposal is a good idea. The given examples reek of being against unwrapping for some reason.</div><div class=""><br class=""></div><div class="">Why not use `if let aBool = aBool where !aBool`? And `if let someValue = someValue where !(otherBoolValue &amp;&amp; someValue &gt; 0)`?</div></div></blockquote><div class=""><br class=""></div></div></div><div dir="ltr" class=""><div class="gmail_quote"><div class="">I think the issue is the complete different meanings of a symbol depending only in where it appears in an expression. Adding that<span class="Apple-converted-space">&nbsp;</span><b class="">!</b>character is really easy to miss in an expression make it at last uncomfortable.</div><div class=""><br class=""></div><div class="">I agree that we are all really used to find<span class="Apple-converted-space">&nbsp;</span><b class="">!</b>&nbsp;in logical expressions and our brain is trained to translate it to NOT automatically but that doesn't mean that it's good idea to keep it there.</div><div class=""><br class=""></div><div class="">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...` ?</div><div class=""><br class=""></div><div class="">I think that clearly&nbsp;<b class="">!</b>&nbsp;is not good choice for negation but my mind is so used to it that I can't totally affirm that<span class="Apple-converted-space">&nbsp;</span><b class="">not</b>&nbsp;is<span class="Apple-converted-space">&nbsp;</span><i class="">the</i>&nbsp;alternative to it. Do we have another alternatives?</div><div class=""><br class=""></div><div class=""><br class=""></div></div></div></div></div><span class=""><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=1p9Jer2O6jVE9KWvo-2B9iUaEyN8slp4IizyiLwsfp54PuIzNf98bk9mcnC9MK7FuAPQNbQF3aF2V9-2FQxdv0tdx7naNusXiMhFu3qrjivt3BLVtqWXFzZ1XAWEnCs1zO1TZLDPbZdBIf9TIa0mm3jX0MaVOjmGwLH1xMACTcDCvU3FwAFA4Pjpqa-2BzuaN-2BMKzlF8DNzNAlzIO4VGhbyz0Xrs3BBz1Mbida-2F5r-2FViPBAKg-3D" alt="" width="1" height="1" border="0" class="" style="min-height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;"><span class="Apple-converted-space">&nbsp;</span>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></span></blockquote></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=7XtDdMHRjqIUi4tzSjSp2pWQIyxYdP6woIWn4vwV5geIOhhDHxMMCUhvHPhaVWjPNeRHPSenv8r1esqoqbPEaSfHyMIe3SGKGNytJ8wy6T83l-2FxBDb7W8MmboUird6-2FVWyZLW24ySHlrl5ftEeIs04vweZ10rgMN5WbRSRqfIatjOa55a3n3c5eygu6R-2BTfc-2FDATUfZVVCJt5tfeecM1T-2FYHJDkBD93RJZdUNO2Nyek-3D" alt="" width="1" height="1" border="0" class="" style="min-height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;"><span class="Apple-converted-space">&nbsp;</span><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""><br class=""></blockquote></div><br class=""></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=CGU22LnxbYa2EM3wKvzuC6syQDwKa0tMs5IyT5gL1wIhcvKUEimjNAVNfW3KOd3djW-2FGC8V8q5Gf78trcTZb6yKTnWTVz85Y3hbS-2BNoHs9LzWqEm4CgYp6x793oSgKcgjlRkRasg39bd3g1iQA3ZJy-2BckJDtgOpkFZXaDtHt4i4zaoW4PSRVZwCY-2FnVYYYRsdsUEUV6sm-2BlQ-2F23Dmj6g7d7bd-2F2AgkDPQcnrhJwcP3c-3D" alt="" width="1" height="1" border="0" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;"><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"><span class="Apple-converted-space">&nbsp;</span>_______________________________________________</span><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">swift-evolution mailing list</span><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><a href="mailto:swift-evolution@swift.org" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">swift-evolution@swift.org</a><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote></div><br class=""></div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=zCg-2FSGF9Wk188a6c55kLyEbrj7YhaXxFEHM-2F-2B0YAlzUgLB68Keg7OQMRVbhFHuk1o7fFYGubd75IQSFk9Xyn3-2BJehcE-2BZQsFNcSGeiSeWgIbuWXyT-2BcCXo-2F19YABwA2AtWLhv5oZ8HyI6ewYTRv7otu0Up3Qw0dOg3iGuDrUK3bRKXaBp8ZPXbRlDLM2m9IZJWd5x80QrxS-2FLyP1qmvpgVyj2T-2FHRd1kP1zSLDFcFAw-3D" alt="" width="1" height="1" border="0" style="font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""><span style="font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><span class="Apple-converted-space">&nbsp;</span>_______________________________________________</span><br style="font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">swift-evolution mailing list</span><br style="font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:swift-evolution@swift.org" style="font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">swift-evolution@swift.org</a><br style="font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote></div><br class="">
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=pngPxwQ4BiP5IDU2rQC6TcjbiXVR4eqjpuzmzac21ki62PD-2F-2BwdbY9oA7yaE2paRCAQvsmbs10pdPLqEqV4ogpnrmZhmCh3FbQpBNawbJ-2BY8QZJp8cp4mCt6dOwd-2BDQZFnrfy2gKFcKv8TRYE8QZhJ7VkGMIMW8SMRDRPzKtMTt9ZW-2FiLImeZfl3dkz5FO5Epix0c6WH2gQHO3i4b1nOThi0HMdbuw7TP9H2eMilXjo-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;" class="">
</div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>