<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 Jul 11, 2016, at 4:59 PM, Xiaodi Wu <<a href="mailto:xiaodi.wu@gmail.com" class="">xiaodi.wu@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">Yup, I too would prefer removing the functions over removing coercion.<br class=""></div></blockquote><div><br class=""></div>Hi Xiaodi,</div><div><br class=""></div><div>Is there a reason you think the coercion is important to keep?</div><div><br class=""></div><div>I see these as somewhat orthogonal issues (allowing or disallowing coercion vs. keeping or removing certain operators that take optionals or for that matter changing the defined behavior in the case of nil operands mixed with non-nil operands).</div><div><br class=""></div><div>Mark</div><div><br class=""><blockquote type="cite" class=""><div class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Mon, Jul 11, 2016 at 18:57 Jacob Bandes-Storch via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Personally I think we should just remove these optional-taking variants of the comparison operators. Does anyone agree/disagree?<div class=""><br class=""></div><div class="">It does make sense to keep ==(T?, T?) and !=(T?, T?), and if coercion were removed, we might want to add (T, T?) and (T?, T) versions. Are there any other operators that would be affected by your proposal? If not, removing the optional </<=/>/>= would obviate the need to remove coercion.</div><div class="gmail_extra"></div></div><div dir="ltr" class=""><div class="gmail_extra"><br clear="all" class=""><div class=""><div data-smartmail="gmail_signature" class=""><div dir="ltr" class=""><div class="">Jacob<br class=""></div></div></div></div></div></div><div dir="ltr" class=""><div class="gmail_extra">
<br class=""><div class="gmail_quote">On Mon, Jul 11, 2016 at 4:45 PM, Mark Lacey <span dir="ltr" class=""><<a href="mailto:mark.lacey@apple.com" target="_blank" class="">mark.lacey@apple.com</a>></span> wrote:<br class=""><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=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Jul 11, 2016, at 4:32 PM, Jacob Bandes-Storch <<a href="mailto:jtbandes@gmail.com" target="_blank" class="">jtbandes@gmail.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class="">Great, thanks Mark! I look forward to it.</div></div></blockquote><div class=""><br class=""></div></span>To be clear, I’m specifically looking at making the change to remove the coercion from T to T? for operator arguments.</div><div class=""><br class=""></div><div class="">I agree there might be other things worth looking at regarding operators that take optionals, but I’m not currently looking at those issues.</div><span class=""><font color="#888888" class=""><div class=""><br class=""></div><div class="">Mark</div></font></span><span class=""><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra">
<br class=""><div class="gmail_quote">On Mon, Jul 11, 2016 at 4:31 PM, Mark Lacey <span dir="ltr" class=""><<a href="mailto:mark.lacey@apple.com" target="_blank" class="">mark.lacey@apple.com</a>></span> wrote:<br class=""><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="">Hi Jacob,<div class=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Jul 11, 2016, at 4:23 PM, Jacob Bandes-Storch via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class="">Bump for Swift 3.<div class="gmail_extra">
<br class=""><div class="gmail_quote">On Thu, Jul 7, 2016 at 2:37 PM, Jacob Bandes-Storch <span dir="ltr" class=""><<a href="mailto:jtbandes@gmail.com" target="_blank" class="">jtbandes@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div class="">These operators cause some potential for confusion:</div><div class=""><br class=""></div><div class=""><div class=""> public func <<T : Comparable>(lhs: T?, rhs: T?) -> Bool</div><div class=""> public func ><T : Comparable>(lhs: T?, rhs: T?) -> Bool<br class=""></div><div class=""> public func <=<T : Comparable>(lhs: T?, rhs: T?) -> Bool<br class=""></div><div class=""> public func >=<T : Comparable>(lhs: T?, rhs: T?) -> Bool</div><div class=""><br class=""></div><div class="">1. The meaning of T? < T? is not immediately obvious (Why is nil < .some(x) for any x? Personally, my intuition says that Optional should only provide a partial order, with .none not being ordered w.r.t. .some(x).)</div><div class=""><br class=""></div><div class="">2. Even if the meaning is understood, it can be surprising when the (T?, T?) -> Bool version is used instead of (T, T) -> Bool.</div><div class=""><br class=""></div><div class="">Prior discussion:</div><div class="">- <a href="http://thread.gmane.org/gmane.comp.lang.swift.devel/2089" target="_blank" class="">http://thread.gmane.org/gmane.comp.lang.swift.devel/2089</a><br class=""></div><div class="">- <a href="http://thread.gmane.org/gmane.comp.lang.swift.evolution/10095" target="_blank" class="">http://thread.gmane.org/gmane.comp.lang.swift.evolution/10095</a></div></div><div class=""><span style="font-size:12.8px" class="">- <a class="">rdar://</a></span><span style="font-size:12.8px" class="">16966712&</span><span style="font-size:12.8px" class="">22833869</span></div><div class=""><span style="font-size:12.8px" class="">- Replies to <a href="https://twitter.com/jtbandes/status/646914031433871364" target="_blank" class="">https://twitter.com/jtbandes/status/646914031433871364</a></span></div><div class=""><span style="font-size:12.8px" class=""><br class=""></span></div><div class=""><span style="font-size:12.8px" class="">In the swift-dev thread from May, Chris said:</span></div><div class=""><span style="font-size:12.8px" class=""><br class=""></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-size:12.8px" class="">One of the ideas that Joe Pamer has been discussing is whether the implicit promotion from T to T? should be disabled when in an operator context. Doing so would fix problems like this, but making the code invalid.</span></blockquote><div style="font-size:12.8px" class=""><br class=""></div></blockquote><div class=""><br class=""></div><div class="">A change like this would be source-breaking, so if the core team has recommendations for how to handle these issues, now is probably the time to get it done.</div></div></blockquote></div></div></div></div></blockquote><div class=""><br class=""></div></span>I overlooked your previous message on this.</div><div class=""><br class=""></div><div class="">I’m actually writing up a proposal for this now, and have an implementation that I’ve done a bit of testing with.</div><div class=""><br class=""></div><div class="">I’m hoping to get the proposal out in the next couple days.</div><span class=""><font color="#888888" class=""><div class=""><br class=""></div><div class="">Mark</div><div class=""><br class=""></div></font></span></div></div></blockquote></div><br class=""></div></div>
</div></blockquote></div><br class=""></span></div></blockquote></div><br class=""></div></div>
_______________________________________________<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="">
</blockquote></div>
</div></blockquote></div><br class=""></body></html>