<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="">-1, never seen a real world situation where this would be confusing/problematic.</div><div class=""><br class=""></div><div class="">Having one operator is nice for chaining:</div><div class=""><br class=""></div><div class="">var value = someArray ?? someFallback ?? secondaryFallback ?? []</div><br class=""><div class="">
<div class="">— Radek</div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 07 Mar 2016, at 22:29, Sébastien Blondiau 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="">Currently, there is only one nil coalescing operator, which may return an optional value or not, depending on the second parameter. This variability can leads to unclear line of code:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><div style="margin: 0px;" class=""><span style="color: rgb(187, 44, 162);" class="">var</span><span style="" class="">&nbsp;isItOptionalOrNot = </span><font color="#4f8187" class="">value</font><span style="" class="">&nbsp;?? </span><font color="#4f8187" class="">otherValue</font></div><div style="color: rgb(79, 129, 135); margin: 0px;" class=""><br class=""></div></div><div class="">I think there should be two distinct operators:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><div style="font-family: Helvetica; font-size: 12px;" class=""><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><span style="color: rgb(187, 44, 162);" class="">var</span><span style="" class="">&nbsp;certainlyOptional =&nbsp;</span><font color="#4f8187" class="">value</font><span style="" class="">&nbsp;</span><span style="" class="">??&nbsp;</span><font color="#4f8187" class="">otherValue</font></div><div style="" class=""><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(79, 129, 135);" class=""><span style="color: rgb(187, 44, 162);" class="">var</span><span style="" class="">&nbsp;</span><span style="" class="">certainlyNotOptional</span><span style="" class="">&nbsp;=&nbsp;</span><font color="#4f8187" class="">value</font><span style="" class="">&nbsp;?! </span><font color="#4f8187" class="">notOptionalValue</font></div></div><div style="" class=""><br class=""></div></div></div></div><div class="">In my point of view, this differentiation brings more clarity about wether the result is an optional or not.</div></div><div class=""><br class=""></div><div class="">What's your opinion?</div><div class=""><br class=""></div><div class="">--</div><div class="">Sébastien Blondiau</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=""></div></blockquote></div><br class=""></body></html>