<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="">Thanks for pointing this out! But I think `foo?.bar(baz(42))` should be equivalent to:</div><div class=""><br class=""></div><div class="">```</div><div class="">if let foo = foo {</div><div class="">&nbsp; &nbsp; let x = baz(42)</div><div class="">&nbsp; &nbsp; foo.bar(x)</div><div class="">}</div><div class="">```</div><div class=""><br class=""></div><div class="">IMHO, this is consistent with my example. Instead of worrying about "short-circuit", we can just treat ? as the syntax sugar of if let?</div><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 15, 2016, at 4:07 PM, Jean-Daniel Dupas &lt;<a href="mailto:mailing@xenonium.com" class="">mailing@xenonium.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><div class=""><br class="Apple-interchange-newline">Le 15 août 2016 à 10:01, Justin Jia via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; a écrit :</div><br class="Apple-interchange-newline"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Aug 15, 2016, at 3:53 PM, Charlie Monroe &lt;<a href="mailto:charlie@charliemonroe.net" class="">charlie@charliemonroe.net</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""><br class="Apple-interchange-newline">On Aug 15, 2016, at 9:46 AM, Justin Jia 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=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">I think the `?` will make the return an optional. So your example should add another ? at the end.</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;"><br class=""></span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">```</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">print(foo(bar(42)?, baz(42)?)?)</span></font></div></div></div></div></blockquote><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">This reads terribly, IMHO.</div><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div></blockquote><div class=""><br class=""></div><div class="">I agree that this reads terribly. But this is only an edge case. I would prefer `let output =&nbsp;<font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">foo(bar(42)?, baz(42)?); print(output?)`. However, I want to argue&nbsp;that for most cases&nbsp;“?” reads better than&nbsp;“if let”.</span></font></div><br class=""><blockquote type="cite" class=""><div class=""><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">```</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;"><br class=""></span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">The above example should be equivalent to:</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;"><br class=""></span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">```</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">let x = bar(42) // X is optional</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">let y = baz(42) // Y is optional</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;"><br class=""></span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">let z = foo(x?, y?) // Z should be optional now</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">print(z?)</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">```</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;"><br class=""></span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">which should be equivalent to;</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;"><br class=""></span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">```</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">let x = bar(42)</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">let y = baz(42)</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;"><br class=""></span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">if let x = x, let y = y {</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&nbsp; &nbsp; z = foo(x, y)</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">}</span></font></div></div></div></div></blockquote><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">What if baz doesn't return optional?</div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""></div></div></blockquote><div class=""><br class=""></div><div class="">If baz doesn’t return optional, then we don’t even need this syntax:</div><div class=""><br class=""></div><div class="">We can just write: `z(bar(42)?, baz(42)` and treat baz(42) like normal.</div><div class=""><br class=""></div><div class="">Which should be equivalent to:</div><div class=""><br class=""></div><div class="">```</div><div class="">```</div><div class=""><blockquote type="cite" class=""></blockquote><span class="" style="font-family: 'Helvetica Neue'; font-size: 12.5px;">let x = bar(42)</span><br class=""><blockquote type="cite" class=""></blockquote><span class="" style="font-family: 'Helvetica Neue'; font-size: 12.5px;">let y = baz(42)</span><br class=""><blockquote type="cite" class=""></blockquote><font color="#00afcd" face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;"><br class=""></span></font><blockquote type="cite" class=""></blockquote><span class="" style="font-family: 'Helvetica Neue'; font-size: 12.5px;">if let x = x {</span><br class=""><blockquote type="cite" class=""></blockquote><span class="" style="font-family: 'Helvetica Neue'; font-size: 12.5px;">&nbsp; &nbsp; z = foo(x, y)</span><br class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">}</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">```</span></font></div></div></div></div></div><br class=""></div></div></div></blockquote><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">It is not consistent which what I expect when calling foo?.bar(baz(42))</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">In that case, if foo is nil, bad is never evaluated.</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><blockquote type="cite" class=""><div class=""><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">if let x = bar(42) {</div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span class="Apple-tab-span" style="white-space: pre;">        </span>let y = baz(42)</div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span class="Apple-tab-span" style="white-space: pre;">        </span>z = foo(x, y)</div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">}</div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">or&nbsp;</div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">let y = baz(42)</div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="">if let x = bar(42) {</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>z = foo(x, y)</div><div class="">}</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">If both are evaluated, this is really inconsistent with</div><div class=""><br class=""></div><div class="">if let x = bar(42), y = baz(42) { ... }</div><div class=""><br class=""></div><div class="">which will short-circuit and baz will not be evaluated if x is evaluated as nil.</div></div><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;"><br class=""></span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">if let z = z {</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&nbsp; &nbsp; print(z)</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">}</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">```</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;"><br class=""></span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">We&nbsp;don’t need to worry about&nbsp;“short-circuit” now because it&nbsp;should be&nbsp;equivalent to the above syntax.</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;"><br class=""></span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; It has been mentioned before (more than once, perhaps, but not in its own thread I don't think, so good luck finding it). IIRC, one of the problems is that it's unclear what happens if your function takes multiple arguments. Does evaluation proceed from left to right? does it short-circuit? Put concretely:</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt;&nbsp;</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; ```</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; func bar(_ x: Int) -&gt;Int? { /* side effects */ }</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; func baz(_ y: Int) -&gt;Int? { /* side effects */ }</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; func foo(_ z: Int, _ a: Int) -&gt;Int { /* ... */ }</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt;&nbsp;</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; print(foo(bar(42)?, baz(42)?))</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; ```</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt;&nbsp;</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; Does baz(42) get evaluated if bar returns nil? Does bar(42) get evaluated if baz returns nil?</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt;&nbsp;</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt;&nbsp;</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; On Mon, Aug 15, 2016 at 2:02 AM, Justin Jia via swift-evolution&lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>(<a href="mailto:swift-evolution@swift.org" class="">mailto:swift-evolution@swift.org</a>)&gt;wrote:</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; Hi!</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt;&nbsp;</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; I don’t know if this has came up before. I tried to search though the mailing list but didn’t find any related threads.</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt;&nbsp;</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; This is purely a syntactic thing (which I know it’s the lowest priority for Swift 4), but I think it’s an important one.</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt;&nbsp;</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; Let’s say we have a struct with a function:</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt;&nbsp;</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; ```</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; struct Foo {</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; func bar(x: Int)</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; }</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; ```</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt;&nbsp;</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; We can use optionals:</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt;&nbsp;</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; ```</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; let foo: Foo? = nil</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; let x = 1</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; foo!.bar(x: x) // Able to compile, but will cause runtime error</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; foo?.bar(x: x) // Able to compile, and won't cause runtime error</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; ```</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt;&nbsp;</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; However:</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt;&nbsp;</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; ```</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; let foo = Foo()</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; let x: Int? = nil</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; foo.bar(x: x!) // Able to compile, but will cause runtime error</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; foo.bar(x: x?) // Won't compile</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; ```</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt;&nbsp;</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; I propose that we should allow `foo.bar(x: x?)`, which should be equivalent to:</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt;&nbsp;</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; ```</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; if let x = x {</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; foo.bar(x: x)</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; }</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; ```</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt;&nbsp;</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; What do you think?</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt;&nbsp;</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; Thanks,</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; Justin</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt;&nbsp;</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; _______________________________________________</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt; swift-evolution mailing list</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt;<span class="Apple-converted-space">&nbsp;</span><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>(<a href="mailto:swift-evolution@swift.org" class="">mailto:swift-evolution@swift.org</a>)</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt; &gt;<span class="Apple-converted-space">&nbsp;</span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt;&nbsp;</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt;&nbsp;</span></font></div><div class="" style="margin: 0px; line-height: normal;"><font face="Helvetica Neue" class=""><span class="" style="font-size: 12.5px;">&gt;&nbsp;</span></font></div></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=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote></div></blockquote></div><br class=""></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote></div></blockquote></div><br class=""></body></html>