An alternative that would seem to satisfy some objections is to have a distinct &quot;unwrap&quot; statement--as in: &quot;unwrap x else { ... }&quot;.<br><div class="gmail_quote"><div dir="ltr">On Mon, Oct 31, 2016 at 14:49 Pyry Jahkola via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="gmail_msg">Going back to the originating message of this thread. This idea (or a variant thereof) has been mentioned in the list of Commonly Rejected Proposals (2nd last bullet under <a href="https://github.com/apple/swift-evolution/blob/master/commonly_proposed.md#control-flow-closures-optional-binding-and-error-handling" class="gmail_msg" target="_blank">Control Flow, Closures, Optional Binding, and Error Handling</a>):<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160829/026796.html" class="gmail_msg" target="_blank">Syntactic sugar for if let self-assignment</a>: An alternative syntax (such as if let foo? { ... } or if let foo=? { ... }) to serve as a shorthand for if let foo = foo { ... } is often proposed and rejected because it is favoring terseness over clarity by introducing new magic syntactic sugar.</blockquote><br class="gmail_msg"></div><div class="gmail_msg">So any discussion on this topic would have to target these concerns first.</div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On 26 Oct 2016, David Goodine wrote:</div><br class="m_-7215180415713745381Apple-interchange-newline gmail_msg"><div class="gmail_msg"><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg">I was typing the above (for the hundredth time) the other day and I was wondering whether it might be worth considering offering a shorter syntax:</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><font face="Courier" class="gmail_msg">guard let x, y, z else {…}</font></div></div></div></blockquote></div><div class="gmail_msg"><br class="gmail_msg"></div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg">That said, while I don&#39;t mind having to repeat the variable name myself, I think David Goodine&#39;s syntax would have to repeat the `let` to align with <a href="https://github.com/apple/swift-evolution/blob/master/proposals/0099-conditionclauses.md" class="gmail_msg" target="_blank">SE-0099</a>, like so:</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><font face="Menlo" class="gmail_msg">    <b class="gmail_msg">guard let</b> x, <b class="gmail_msg">let</b> y, <b class="gmail_msg">let</b> z <b class="gmail_msg">else</b> { ... }</font></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Personally, I wouldn&#39;t mind if this syntax existed. I think it explains itself rather well. And today, unlike when it was first discussed a long time before SE-0099, it&#39;s no longer confusable with Boolean conditions.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">But it&#39;s certainly out of scope for Swift 4 phase 1.</div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><div class="gmail_msg">— Pyry</div></div><div class="gmail_msg"><br class="gmail_msg"></div></div>_______________________________________________<br class="gmail_msg">
swift-evolution mailing list<br class="gmail_msg">
<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg">
</blockquote></div>