<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="">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="color: rgb(0, 0, 0);" class=""> isItOptionalOrNot = </span><font color="#4f8187" class="">value</font><span style="color: rgb(0, 0, 0);" class=""> ?? </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="color: rgb(0, 0, 0);" class=""> certainlyOptional = </span><font color="#4f8187" class="">value</font><span style="color: rgb(0, 0, 0);" class=""> </span><span style="color: rgb(0, 0, 0);" class="">?? </span><font color="#4f8187" class="">otherValue</font></div><div style="color: rgb(0, 0, 0);" 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="color: rgb(0, 0, 0);" class=""> </span><span style="color: rgb(0, 0, 0);" class="">certainlyNotOptional</span><span style="color: rgb(0, 0, 0);" class=""> = </span><font color="#4f8187" class="">value</font><span style="color: rgb(0, 0, 0);" class=""> ?! </span><font color="#4f8187" class="">notOptionalValue</font></div></div><div style="color: rgb(0, 0, 0);" 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></body></html>