<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="">Yes, this is the proper channel to discuss this kind of proposal.&nbsp;</div><div class=""><br class=""></div><div class="">What you’re proposing has been brought up before, or as Chris Lattner put it:</div><div class="">“Yes, this has thoroughly been beaten to death. It is also outside the scope of Swift 4 stage 1. That said, it is such a glaring problem that we’ll have to deal with it at some&nbsp;point.”</div><div class=""><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20161024/028448.html" class="">https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20161024/028448.html</a></div><div class=""><br class=""></div><div class="">I don’t recall if there was a conclusion other than that it was out of scope.</div><div class=""><br class=""></div><div class="">This message from 26 October 2016 seems to be the start of the longest discussion of it that I could find:&nbsp;</div><div class=""><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20161024/028440.html" class="">https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20161024/028440.html</a></div><div class=""><br class=""></div><div class="">Also, Erica Sadun drafted a proposal for it:</div><div class=""><a href="https://gist.github.com/erica/db9ce92b3d23cb20799460f603c0ae7c" class="">https://gist.github.com/erica/db9ce92b3d23cb20799460f603c0ae7c</a></div><div class=""><br class=""></div><div class="">Unfortunately, given how close to release it is, I would guess that it’s still out of scope for Swift 4.&nbsp;</div><div class="">If it’s out of scope, Ted&nbsp;Kremenek very recently gave some input on “Swift phases and mis-timed proposals”:</div><div class=""><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170612/037340.html" class="">https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170612/037340.html</a></div><div class=""><br class=""></div><div class="">Regards,</div><div class="">David</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On 10 Jun 2017, at 06:07, Justin Oroz 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="">First time trying to contribute, hopefully this is the proper channel to submit.<br class=""><br class="">I propose an addition to the guard let statement to allow for replacement of optionals with unwrapped values.<br class=""><br class="">ex)<br class=""><br class="">two current options<br class=""><br class=""><br class="">obj.methodWithCallback() {(foo, bar) in<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>guard let foo = foo else { <br class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>return<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span><br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>foo.prop = “new”<br class="">}<br class=""><br class="">OR<br class=""><br class="">obj.methodWithCallback() {(foo, bar) in<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>guard foo != nil else { <br class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>return<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span><br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>foo!.prop = “new”<br class="">}<br class=""><br class=""><br class="">I propose the following option:<br class=""><br class="">obj.methodWithCallback() {(foo, bar) in<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>guard foo else { <br class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>return<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span><br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>foo.prop = “new”<br class="">}<br class=""><br class="">This reduces the seemingly redundant "guard let foo = foo” statement and removes the unnecessary forced optional unwrapping. <br class=""><br class="">- Justin<br class=""><br class=""><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></div></blockquote></div><br class=""></body></html>