<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>As much fun as it to example with foo, I would argue the opposite when you use some real world variable names:</div><div><br></div><div>if let someInterestingViewConroller = <span style="background-color: rgba(255, 255, 255, 0);">someInterestingViewConroller {</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">}</span></div><div><br></div><div>vs</div><div><br></div><div>If let&nbsp;<span style="background-color: rgba(255, 255, 255, 0);">someInterestingViewConroller {</span></div><div>}</div><div><br></div><div>We know what let does and it should be enough to impart the necessary information for this statement.</div><div><br></div><div>When it comes to newcomers I think you'd be hard pressed to find somebody who'd be able to understand either form without teaching; so not losing much there.<br><br></div><div><br>On Dec 19, 2015, at 10:01 AM, Chris Lattner 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><meta http-equiv="Content-Type" content="text/html charset=utf-8"><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 11, 2015, at 8:19 AM, Jeff Kelley 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=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I’ve had similar ideas to this. Instead of ditching the <font face="Menlo" class="">if let</font> syntax altogether, another approach would be to use the existing name if no new name is given, so that this code:<div class=""><br class=""></div><div class=""><font face="Menlo" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>if let foo = foo { /* use foo */ }</font></div><div class=""><br class=""></div><div class="">could become this code:</div><div class=""><br class=""></div><div class=""><font face="Menlo" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>if let foo { /* use foo */ }</font></div><div class=""><br class=""></div><div class="">In both cases, <font face="Menlo" class="">foo</font> is non-optional inside the braces. If you gave it another name with the <font face="Menlo" class="">if let</font> syntax, that would work as it does today.<br class=""></div></div></div></blockquote><br class=""></div><div>Hi Jeff,</div><div><br class=""></div><div>This is commonly requested - the problem is that while it does help reduce boilerplate, it runs counter to the goal of improving clarity.</div><div><br class=""></div><div>-Chris</div><br class="">
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=1Ry8ov4zuU66O51YNcjYWXuMGf2gObG8uPwoJz-2B4Z1VqMdeyeesw-2Bc9SDkZTEmLmnofSO3tNgiMGF47sxE879Ut5x-2F6sLSrTgmZhXJOq-2B59bEaSmJ0a44hp5limyi-2FpsrcKvySjRuPP0gLr6FoeZNJoisevK-2BimrVdnhvmWcLj69rx67MHqizgTcdJrprVSbV2f-2FkGqilX9aSsmL60yEZg-3D-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;">

</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>