<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On 15 Feb 2017, at 22:44, Nicolas Fezans 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 class="">&gt; 3: maybe ~ is a better fit?<br class=""></div><div class=""><br class=""></div><div class="">just for information this is in line with Matlab in which the following three "not"-related syntax exist:</div><div class="">a) ~ as a prefix operator for not</div><div class="">b) not as a function</div><div class="">c) ~= as an infix operator for "is not equal to"</div><div class=""><br class=""></div><div class="">I see pros and cons for each option and have a very slight preference for ~ over !.</div><div class=""><br class=""></div><div class="">I would however avoid&nbsp;<span style="font-family:Menlo" class="">¬&nbsp;</span>because I would not like to have a character that is not directly accessible on most keyboards for something as simple as a not operation, even if I like these maths notations very much.</div><div class=""><br class=""></div><div class="">If it would be decided to keep ! I could imagine that &nbsp;adding syntax coloration in code editors to make both uses of ! look a bit different would help beginners and newcomers. This is more complicated to do than the typical syntax coloration logic in text editors (syntax must be understood for doing that), but this should not be a problem in Xcode.</div><div class=""><br class=""></div><div class="">If ~ would be preferred, I would recommend to continue accepting ! for one or more versions of swift but with a warning recommending to change it (we do not need to make a source breaking change when it is possible to continue accepting it and to mark it as obsolete)</div></div></blockquote><div><br class=""></div><div>Tilde is already used in Swift for bit-flipping, though actually on a boolean type (if you treat it as 1-bit) bit-flipping and logical NOT are equivalent, and you can't use logical NOT an Ints at the moment anyway.</div><div>So tilde could be a good option, however the ~= operator also already exists in Swift for pattern matching, so couldn't be used as a replacement for !=, unless there's a better operator for pattern matching (personally I don't like using an operator for pattern matching at all but maybe that's just me).</div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On 15 Feb 2017, at 22:28, Derrick Ho via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br class="m_-1832299547513613812Apple-interchange-newline gmail_msg"><div class="gmail_msg">There is no need to change it<br class="gmail_msg"><br class="gmail_msg">Since the context basically disambiguates the meaning of !<br class="gmail_msg"><br class="gmail_msg">The next best thing is to compare it to false<br class="gmail_msg"><br class="gmail_msg">(val == false) // same as !val<br class="gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg">On Wed, Feb 15, 2017 at 3:02 PM David Waite via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="gmail_msg">If someone came with a nice syntax I’d be for this. I can’t imagine what that would be.<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I doubt there is an alternate prefix or postfix operator that would pass muster, due to ‘!’ already meaning the appropriate thing in so many languages, and swift only supporting symbolic operators.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I can’t think of a method on boolean which would read properly either, e.g.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><span class="gmail_msg m_-1832299547513613812m_-8132155900057031411Apple-tab-span" style="white-space:pre-wrap">        </span>if isValid.not() {…}</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">The closest I could think to a decent bike shed color would be a global function:</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><span class="gmail_msg m_-1832299547513613812m_-8132155900057031411Apple-tab-span" style="white-space:pre-wrap">        </span>if not(isValid) {…}</div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">-DW</div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On Feb 15, 2017, at 11:10 AM, Robert Widmann via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br class="gmail_msg m_-1832299547513613812m_-8132155900057031411Apple-interchange-newline"><div class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg">So you've identified the problem, but what do you propose as a solution here? &nbsp;</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">It should be noted that a (non-stdlib) language-level answer to this question has already been discussed and rejected (<a href="https://lists.swift.org/pipermail/swift-evolution/2015-December/000032.html" class="gmail_msg" target="_blank">https://lists.swift.org/pipermail/swift-evolution/2015-December/000032.html</a>).</div><div class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg">~Robert Widmann</div></div><div class="gmail_msg"><br class="gmail_msg">2017/02/15 9:02、Sadiq via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt; のメッセージ:<br class="gmail_msg"><br class="gmail_msg"></div><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg">Hello,<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I would like to suggest to change Logical NOT Operator from ! to something else.&nbsp;</div><div class="gmail_msg">It will increase the readability of the code and will avoid any confusion with the symbol used for force unwrapping of optional values.&nbsp;</div><div class="gmail_msg">It would be easier for new programmers to learn Swift as the first language.&nbsp;</div><div class="gmail_msg">I don't understand the rational behind using the same operator for two different purposes.&nbsp;</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Thanks and Regards,</div><div class="gmail_msg">Mohammad Sadiq</div></div>
</div></blockquote><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><span class="gmail_msg">_______________________________________________</span><br class="gmail_msg"><span class="gmail_msg">swift-evolution mailing list</span><br class="gmail_msg"><span class="gmail_msg"><a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a></span><br class="gmail_msg"><span class="gmail_msg"><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br class="gmail_msg"></div></blockquote></div>_______________________________________________<br class="gmail_msg">swift-evolution mailing list<br class="gmail_msg"><a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg"><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg"></div></blockquote></div><br class="gmail_msg"></div></div></div>_______________________________________________<br class="gmail_msg">
swift-evolution mailing list<br class="gmail_msg">
<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg">
</blockquote></div>
_______________________________________________<br class="gmail_msg">swift-evolution mailing list<br class="gmail_msg"><a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg"><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg"></div></blockquote></div><br class="gmail_msg"></div></div>_______________________________________________<br class="gmail_msg">
swift-evolution mailing list<br class="gmail_msg">
<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg">
</blockquote></div></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=""></blockquote></div><br class=""></body></html>