<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 24, 2016, at 7:31 PM, Dany St-Amant &lt;<a href="mailto:dsa.mls@icloud.com" class="">dsa.mls@icloud.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><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=""><span class=""></span></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=""><div class="">Reading some old threads...</div><div class=""><br class=""></div><div class="">Le 16 août 2016 à 15:12, Xiaodi Wu via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; a écrit&nbsp;:<br class=""><br class=""></div><blockquote type="cite" class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Tue, Aug 16, 2016 at 12:14 PM, Justin Jia<span class="Apple-converted-space">&nbsp;</span><span dir="ltr" class="">&lt;<a href="mailto:justin.jia.developer@gmail.com" target="_blank" class="">justin.jia.developer@gmail.com</a>&gt;</span><span class="Apple-converted-space">&nbsp;</span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="auto" class=""><div class=""></div><div class="">I was trying to argue with reason. You kept stating your *opinion*. You still didn't explain *why*. For example, why "if statements can and function calls can't" and why "this severely violates user expectations"?</div></div></blockquote><div class=""><br class=""></div><div class="">These were not meant as expressions of opinion. Currently, in Swift, `if` statements can short circuit and function calls cannot. Your proposal would introduce short-circuiting where currently there can be none, and thus it would severely violate user expectations.</div></div></div></div></blockquote><div class=""><br class=""></div><span style="background-color: rgba(255, 255, 255, 0);" class="">Function calls can currently be short-circuited... if there's try and throw involved.</span><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class=""><br class=""></span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">let z = try g(f1(a), f2(b), f3(c)) // Must be within do {} catch {}</span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class=""><br class=""></span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">Assuming f1(), f2(), f3() can all throws, f2() is only called if f1() did not throw, and f3() if neither f1() nor f2() threw. The behavior is/seems to be: Pure left to right execution order regardless of throwing ability.</span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class=""><br class=""></span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">If g() doesn't throw, the above (with exact same behavior) can be written more verbosely and explicitly as:</span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class=""><br class=""></span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">let y = g(try f1(a), try f2(b), try f3(c)) // Must be within do {} catch {}</span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class=""><br class=""></span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">Yet another way to do the call is:</span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class=""><br class=""></span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">let x = try? g(f1(a), f2(b), f3(c)) // z is nil on throws</span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class=""><br class=""></span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">So implementing something like what Justin is asking should fit within Swift, as long as it follows the try short-circuit logic. However, the use of a trailing question-mark to provide this functionality is not explicit enough to my taste (and to my weakening eyesight). Could we reuse let but with a question-mark? Or maybe guard.</span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class=""><br class=""></span></div></div></div></blockquote><div><br class=""></div><div>Good point! Edge cases always exist.</div><br class=""><blockquote type="cite" class=""><div class=""><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=""><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">let z = g(let? f1(a), let? f2(b), let? f3(c))</span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">// z is nil on fX() == nil, otherwise Optional(g()) just like try? wrapping</span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">// left to right short-circuit à la let z = try?</span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class=""><br class=""></span></div></div></div></blockquote><div><br class=""></div><div>This sounds like a good idea. Moving the keyword to the front is more explicit. But `let? f1(a)` seems a little bit weird to me.</div><div><br class=""></div><div>What about `let x = if? foo(x, y)` But… should we introduce `if!` as well?</div><div><br class=""></div><div>```</div><div>func foo(x: Any, y: Any) { … }</div><div><br class=""></div><div>let x: Any? = nil</div><div>let y: Any? = nil</div><div>if? foo(x, y) // If x and y both can be unwrapped, execute foo().</div><div>if? foo(x?, y?) // Or if we want to be a little bit more clear, specify which argument could be optional</div><div>```</div><div><br class=""></div><div>```</div><div>if! foo(x, y) // Will crash if nil is found.</div><div>if! foo(x!, y!) // To be more clear</div><div>```</div><div><br class=""></div><div>Backward compatibility:</div><div><br class=""></div><div>```</div><div>foo(x!, y!) // warning: add if! before the function</div><div>```</div><br class=""><blockquote type="cite" class=""><div class=""><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=""><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">Though, this may ask for also supporting something like:</span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class=""><br class=""></span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">let x = g(let? try? f1(a), let? try? f2(b), let? try? f3(c))</span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class=""><br class=""></span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">This allow selective discard of throws, instead of a discard all of a plain 'let x = try? ...'</span></div><div class=""></div><div class=""><br class=""></div></div></div></blockquote><div><br class=""></div><div>Yes.</div><div><br class=""></div><blockquote type="cite" class=""><div class=""><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=""><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">Dany</span></div><div class=""><br class=""></div><blockquote type="cite" class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="auto" class="">... snip ...</div></blockquote><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="auto" class=""><div class="h5"><blockquote type="cite" class=""><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><blockquote type="cite" class=""><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><br class=""><blockquote type="cite" class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><div class=""><blockquote type="cite" class=""><div class="">On Aug 16, 2016, at 1:16 AM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank" class="">xiaodi.wu@gmail.com</a>&gt; wrote:</div><br class=""><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><div class="gmail_extra"><div class="gmail_quote">On Mon, Aug 15, 2016 at 12:07 PM, Xiaodi Wu<span class="">&nbsp;</span><span dir="ltr" class="">&lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank" class="">xiaodi.wu@gmail.com</a>&gt;</span><span class="">&nbsp;</span>wrote<wbr class="">:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><span class="">On Mon, Aug 15, 2016 at 11:43 AM, Justin Jia<span class="">&nbsp;</span><span dir="ltr" class="">&lt;<a href="mailto:justin.jia.developer@gmail.com" target="_blank" class="">justin.jia.developer@<wbr class="">gmail.com</a>&gt;</span><span class="">&nbsp;</span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><div class=""><div class="">I believe the core team has considered 99% of the ideas in the mailing list in the past, but it doesn’t mean we can’t discuss it, right?</div></div></div></blockquote><div class="">.. snip ...</div></span><span class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><div class=""><div class=""><br class=""></div><div class="">Back to the original topic.</div><div class=""><br class=""></div><div class="">I spent some time thinking and changed my mind again. I think solution 1 is most reasonable. It is consistent with if statements. Instead of treating it as sugar for `if let`, we can treat it as sugar for `guard`, which is much easy to understand and remember.</div><div class=""><br class=""></div><div class="">-</div><div class=""><br class=""></div><div class="">Below is the reason why I think this feature is important (quoted from another email).</div><div class=""><br class=""></div><div class="">The problem with `if let` is you need to call the function inside { }.</div><div class=""><br class=""></div><div class="">```</div><div class="">/* code 1 */</div><span class=""><div class="">if let x = x, let y = y {</div></span><div class="">&nbsp; &nbsp;<span class="">&nbsp;</span>/* code 2, depends on x and y to be non-optional */</div><div class="">&nbsp; &nbsp;<span class="">&nbsp;</span>let z = foo(x, y)</div><div class="">&nbsp; &nbsp;<span class="">&nbsp;</span>if let z = z {</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp;<span class="">&nbsp;</span>bar(z)</div><div class="">&nbsp; &nbsp;<span class="">&nbsp;</span>}</div><div class="">&nbsp; &nbsp;<span class="">&nbsp;</span>/* code 3, depends on x and y to be non-optional */</div><div class="">}</div><div class="">/* code 4 */</div><div class="">```</div><div class=""><br class=""></div><div class="">I can't use `guard` for this situation because guard will force me to leave the entire function.</div></div></div></blockquote></span></div></div></div></blockquote><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><div class=""><div class=""><br class=""></div><div class="">```</div><div class="">/* code 1 */</div><span class=""><div class="">guard let x = x, y = y else { return }</div></span><div class="">/* code 2, depends on x and y to be non-optional */</div><span class=""><div class="">guard let z = foo(x, y) else { return }</div><div class="">bar(z)</div></span><div class="">/* code 3, depends on x and y to be non-optional */ &lt;- This won't execute if z is nil</div><div class="">/* code 4 */ &lt;- This won't execute if x, y or z is nil</div><span class=""><div class="">```</div></span></div></div></blockquote><div class=""><br class=""></div></span><div class="">Then surround it with a do block.</div><div class=""><br class=""></div><div class="">```</div><div class="">out: do {</div><div class="">&nbsp;<span class="">&nbsp;</span>guard foo else { break out }</div><div class="">&nbsp;<span class="">&nbsp;</span>guard bar else { break out }</div><div class="">&nbsp;<span class="">&nbsp;</span>/* other code */</div><div class=""><div class=""><div class="">}</div><div class="">```</div></div></div></div></div></div></blockquote><div class=""><br class=""></div><div class="">Or, more idiomatically, since your use case is that you want /* code 4 */ to be executed no matter what, while everything else depends on x and y not being nil:</div><div class=""><br class=""></div><div class="">```</div><div class="">defer { /* code 4 */ }</div><div class="">guard let x = x, let y = y else { return }</div><div class="">/* code 2 */</div><div class="">/* code 3 */</div><div class="">```</div><div class=""><br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><div class=""><span class=""><div class=""><br class=""></div><div class="">What I really want is some like this:</div><div class=""><br class=""></div><div class="">```</div><div class="">/ * code 1 */</div></span><span class=""><div class="">let z = foo(x?, y?)</div></span><div class="">/* code 2, depends on x and y to be non-optional, use x? and y? */</div><div class="">bar(z?)</div><div class="">/* code 3, depends on x and y to be non-optional, use x? and y? */</div><div class="">/* code 4 */</div><div class="">```</div><div class="">This is much easier to read. Sometimes people choose to use `guard` to avoid `{ }`, which usually lead to code could easily get wrong (like the second example).</div><div class=""><br class=""></div><div class="">Sincerely,</div><div class="">Justin</div></div><div class=""><div class=""><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Aug 15, 2016, at 11:41 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank" class="">xiaodi.wu@gmail.com</a>&gt; wrote:</div><br class=""><div class=""><div style="white-space: pre-wrap;" class="">What do you mean, limited to variables? What about a computed property? You will have the same problem.<br class=""><br class="">I'm not sure where you want to go with this, given that the core team has considered the same idea in the past and found these issues to have no good solution.<br class=""></div><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Mon, Aug 15, 2016 at 04:56 Justin Jia &lt;<a href="mailto:justin.jia.developer@gmail.com" target="_blank" class="">justin.jia.developer@gmail.<wbr class="">com</a>&gt; wrote:<br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="auto" class=""><div class=""></div><div style="direction: inherit;" class="">IMO I don't this bar should be evaluated unless we decide if let can accept non-optional values.&nbsp;</div><div style="direction: inherit;" class=""><br class=""></div><div style="direction: inherit;" class="">Actually, what if we allow if let to accept non-optional values?</div><div style="direction: inherit;" class=""><br class=""></div><div style="direction: inherit;" class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">I agree this is confusing at the beginning. But people who are not familiar with the detail design can avoid this situation easily. People who are familiar with the design can adopt it quickly. Sometimes, this is unavoidable.&nbsp;</span></div><div style="direction: inherit;" class=""><br class=""></div><div style="direction: inherit;" class="">Btw, do you think this is still something nice to have if we limit this syntax to only variables?</div></div><div dir="auto" class=""><div class=""><div style="direction: inherit;" class=""><br class=""></div>On Aug 15, 2016, at 4:59 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank" class="">xiaodi.wu@gmail.com</a>&gt; wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div dir="ltr" class="">On Mon, Aug 15, 2016 at 3:55 AM, Xiaodi Wu<span class="">&nbsp;</span><span dir="ltr" class="">&lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank" class="">xiaodi.wu@gmail.com</a>&gt;</span><span class="">&nbsp;</span>wrote<wbr class="">:<br class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class=""><div class=""><div class="">On Mon, Aug 15, 2016 at 3:25 AM, Justin Jia via swift-evolution<span class="">&nbsp;</span><span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-<wbr class="">evolution@swift.org</a>&gt;</span><span class="">&nbsp;</span>wrote:<br class=""></div></div><div class="gmail_extra"><div class="gmail_quote"><div class=""><div class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Aug 15, 2016, at 4:09 PM, Charlie Monroe &lt;<a href="mailto:charlie@charliemonroe.net" target="_blank" class="">charlie@charliemonroe.net</a>&gt; wrote:</div><br class=""><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">The example above was to better demonstrate the problem with *when* to evaluate the latter argument. Why should both arguments be evaluated *before* the if statement? If both calls return Optionals,&nbsp;</div><span class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">if let x = bar(42), y = baz(42) { ... }</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><br class=""></div></span><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">is how would I write it without the suggested syntax - baz(42) will *not* be evaluated if bar(42) returns nil. Which bears a question why would&nbsp;</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">foo(bar(42)?, baz(42)?)&nbsp;</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">evaluate both arguments even if the first one is nil, making it incosistent with the rest of the language?</div></div></blockquote></div><br class=""><div class="">I see your point. I understand that maybe 1/2 of the people think we should evaluate both arguments and 1/2 of the people think we should only evaluate the first argument.</div><div class=""><br class=""></div><div class="">I changed my idea a little bit. Now I think you are right. We should only evaluate the first argument in your example. It’s not only because of inconsistent, but also because the language should at least provide a way to “short-circuit” to rest of the arguments.</div><span class=""><div class=""><br class=""></div><div class="">If they want to opt-out this behavior, they can always write:</div><div class=""><br class=""></div><div class="">```</div><div class="">let x = bar(42)</div><div class="">let y = baz(42)</div></span><div class="">foo(x?, y?)</div><div class="">```</div></div></blockquote><div class=""><br class=""></div></div></div><div class="">Well, that was just the easy part. Now, suppose bar is the function that isn't optional.</div><div class=""><br class=""></div><div class="">```</div><div class="">foo(bar(42), baz(42)?)</div><div class="">```</div><div class=""><br class=""></div><div class="">Is bar evaluated if baz returns nil? If you want this syntax to be sugar for if let, then the answer is yes.</div></div></div></div></blockquote><div class=""><br class=""></div><div class="">s/yes/no/</div><div class="">&nbsp;</div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class="">If short-circuiting works left-to-right, then the answer is no.</div></div></div></div></blockquote><div class=""><br class=""></div><div class="">s/no/yes/&nbsp;</div><div class=""><br class=""></div><div class="">(See? Confusing.)</div><div class="">&nbsp;<br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class="">This is very confusing, and there is no good intuitive answer.&nbsp;<br class=""></div><span class=""><div class=""><br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><div class=""></div></div><br class="">______________________________<wbr class="">_________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/<wbr class="">mailman/listinfo/swift-<wbr class="">evolution</a></blockquote></span></div></div></div></blockquote></div></div></div></div></blockquote></div></blockquote></div></div></blockquote></div></div></div></div></blockquote></div></div></div></div></blockquote></div></div></div></div></blockquote></div><br class=""></div><br class=""></blockquote></div><br class=""></div></div></blockquote></div></blockquote></div></blockquote></div></blockquote></div></blockquote></div></div></blockquote></div><br class=""></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></div></blockquote></div></div></blockquote></div><br class=""></body></html>