<html><head></head><body><div style="font-family: 'SFUIText-Regular', 'SF UI Text'; font-size: 12pt; color: rgba(0, 0, 0, 1.0);"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Correct me if I’m wrong, but wouldn’t you have to unwrap every comparison then?<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 11, 2016, at 20:02, David Sweeris via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class=""><div class="">Why not have them return a `Bool?`? If both arguments are non-nil, it can return the results of the comparison, otherwise it can return nil.<br class=""><br class="">- Dave Sweeris</div><div class=""><br class="">On Jul 7, 2016, at 16:37, Jacob Bandes-Storch via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><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" 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" class="">http://thread.gmane.org/gmane.comp.lang.swift.evolution/10095</a></div></div><div class=""><span style="font-size:12.8px" class="">- <a href="rdar://" 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" 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><br clear="all" class=""><div class=""><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div class="">Jacob<br class=""></div></div></div></div>
</div>
</div></blockquote><blockquote type="cite" class=""><div class=""><span class="">_______________________________________________</span><br class=""><span class="">swift-evolution mailing list</span><br class=""><span class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a></span><br class=""><span class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br class=""></div></blockquote></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=""></div></div></div></body></html>