<div>> 3: maybe ~ is a better fit?<br></div><div><br></div><div>just for information this is in line with Matlab in which the following three "not"-related syntax exist:</div><div>a) ~ as a prefix operator for not</div><div>b) not as a function</div><div>c) ~= as an infix operator for "is not equal to"</div><div><br></div><div>I see pros and cons for each option and have a very slight preference for ~ over !.</div><div><br></div><div>I would however avoid <span style="font-family:Menlo">¬ </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><br></div><div>If it would be decided to keep ! I could imagine that 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><br></div><div>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><br></div><div><br></div><div>Nicolas </div><div><br></div><div><br><div class="gmail_quote"><div>On Wed, 15 Feb 2017 at 22:55, André “Zephyz” Videla via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br></div><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">As of today, this is possible:<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><div style="margin:0px;line-height:normal;font-family:Menlo;color:rgb(186,45,162)" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">prefix</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" class="gmail_msg"> </span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">operator</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" class="gmail_msg"> ¬</span></div><div style="margin:0px;line-height:normal;font-family:Menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:#ba2da2" class="gmail_msg">prefix</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#ba2da2" class="gmail_msg">func</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> ¬ (value: </span><span style="font-variant-ligatures:no-common-ligatures;color:#703daa" class="gmail_msg">Bool</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">) -> </span><span style="font-variant-ligatures:no-common-ligatures;color:#703daa" class="gmail_msg">Bool</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> {</span></div><div style="margin:0px;line-height:normal;font-family:Menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#ba2da2" class="gmail_msg">return</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#3e1e81" class="gmail_msg">!</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">value</span></div><div style="margin:0px;line-height:normal;font-family:Menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">}</span></div><div style="margin:0px;line-height:normal;font-family:Menlo;min-height:14px" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"></span><br class="gmail_msg"></div><div style="margin:0px;line-height:normal;font-family:Menlo;color:rgb(186,45,162)" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">let</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000" class="gmail_msg"> t = </span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">true</span></div><div style="margin:0px;line-height:normal;font-family:Menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:#ba2da2" class="gmail_msg">let</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> f = </span><span style="font-variant-ligatures:no-common-ligatures;color:#31595d" class="gmail_msg">¬</span><span style="font-variant-ligatures:no-common-ligatures;color:#4f8187" class="gmail_msg">t</span></div></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I have to admit that I quite like this but it has a couple drawbacks:</div><div class="gmail_msg">1: if you've never seen the ¬ operator in math it makes no more sense than "!"</div><div class="gmail_msg">2: It's quite tricky to find on your keyboard depending on your layout</div><div class="gmail_msg">3: maybe ~ is a better fit?</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Seems like a lot of work for a very small improvement. But I'm all for it.</div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">André</div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><br 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 <<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>> 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 <<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>> 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="m_-1832299547513613812m_-8132155900057031411Apple-tab-span gmail_msg" 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="m_-1832299547513613812m_-8132155900057031411Apple-tab-span gmail_msg" 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 <<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>> 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? </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 <<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>> のメッセージ:<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. </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. </div><div class="gmail_msg">It would be easier for new programmers to learn Swift as the first language. </div><div class="gmail_msg">I don't understand the rational behind using the same operator for two different purposes. </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>