<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">To me the short syntax should be a ‘macro’ expansion (syntax sugar only), therefore option 1 in Nick’s example. I choose the syntax sugar option because it is easy to explain.&nbsp;<br><br><div id="AppleMailSignature">-- Howard.&nbsp;</div><div><br>On 12 Dec 2017, at 7:03 pm, Nick Keets via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 12, 2017 at 12:42 AM, Slava Pestov via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><br><div><div>I think it gets confusing when you have multiple levels of nested expressions, eg</div><div><br></div><div>foo(bar(x?)) + y?</div><div><br></div><div>Slava</div></div></div></blockquote><div><br></div><div>I'm not sure we need to optimize much for complicated nested examples, as I don't think this is something that will happen a lot in practice. I imagine the most common scenario will be a single call with one or more arguments.</div><div><br></div><div>Having said that, we did receive 2 different reasonable answers on what the evaluation order would be for:</div><div><span style="white-space:pre">        </span>f(a(), b?)</div><div><br></div><div>(1) It desugars to:</div><div><br></div><div>if let someB = b {</div><div><span style="white-space:pre">        </span>f(a(), someB)</div><div>}</div><div><br></div><div>So a() doesn't get called if b is nil.</div><div><br></div><div>(2) "If you were to write this logic out by hand then you would short-circuit it and this is analogous to current chaining behaviour so to me evaluating left to right (as Swift usually does) and stopping at the first failed unwrap would make sense"</div><div><br></div><div>So a() gets called if b is nil.</div><div><br></div><div>&nbsp;</div></div><br></div></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></body></html>