<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><blockquote type="cite" class=""><div class="">On May 27, 2016, at 4:35 PM, Brent Royal-Gordon via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><div class=""><div class="">I am not a fan of this syntax. `;` reads very strongly as a statement ender to me,</div></div></blockquote><div><br class=""></div><div>Technically speaking, Swift uses semicolon as a separator, not a line ender. &nbsp;We already use it to separate multiple expressions on the same line, typically when those expressions are side effecting:</div><div><br class=""></div><div>&nbsp; &nbsp;print(“foo”); print(“bar”) &nbsp; // silly example</div><div><br class=""></div><div>The proposal is consistent with this usage.</div><br class=""><blockquote type="cite" class=""><div class=""><div class=""> and yet at the same time, it's still visually quite close to `,`. My first impression was that the proposal had an embarrassing typo in the very first example.<br class=""></div></div></blockquote><div><br class=""></div><div>Particularly if we end up with Matthew’s proposal to allow omitting the semicolon when it is at the end of the line, I think we’d end up with much nicer looking code in practice. &nbsp;Here are a couple of random example conditions I pulled from AlamoFire (feel free to pick some of your own):</div><div><br class=""></div><div>Now:</div><div><font face="Menlo" class="">&nbsp; &nbsp; &nbsp;if&nbsp;let<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;path&nbsp;=&nbsp;fileURL.path,<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fileSize&nbsp;=&nbsp;try&nbsp;NSFileManager.defaultManager().attributesOfItemAtPath(path)[NSFileSize]&nbsp;as?&nbsp;NSNumber</font></div><div><font face="Menlo" class="">&nbsp; &nbsp; &nbsp;{<br class=""></font>&nbsp; &nbsp; &nbsp;&nbsp;</div><div><br class=""><font face="Menlo" class="">&nbsp; &nbsp; &nbsp;guard&nbsp;let<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; path&nbsp;=&nbsp;fileURL.path<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;where&nbsp;NSFileManager.defaultManager().fileExistsAtPath(path, isDirectory:&nbsp;&amp;isDirectory)&nbsp;&amp;&amp;&nbsp;!isDirectory&nbsp;else<br class="">&nbsp; &nbsp; &nbsp; &nbsp; {</font></div><div><br class=""><font face="Menlo" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;let&nbsp;path&nbsp;=&nbsp;fileURL.path&nbsp;where&nbsp;NSFileManager.defaultManager().fileExistsAtPath(path) {<br class=""></font><br class=""></div><div><br class=""></div><div>With SE-0099 + Matthew’s extension, this could be written more nicely as:</div><div><br class=""></div><div><div><font face="Menlo" class="">&nbsp; &nbsp; &nbsp;if&nbsp;let&nbsp;path&nbsp;=&nbsp;fileURL.path<br class="">&nbsp; &nbsp; &nbsp; &nbsp; let fileSize&nbsp;=&nbsp;try&nbsp;NSFileManager.defaultManager().attributesOfItemAtPath(path)[NSFileSize]&nbsp;as?&nbsp;NSNumber</font></div><div><font face="Menlo" class="">&nbsp; &nbsp; &nbsp;{</font><br class=""></div><div><br class=""><font face="Menlo" class="">&nbsp; &nbsp; &nbsp;guard&nbsp;let&nbsp;path&nbsp;=&nbsp;fileURL.path<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NSFileManager.defaultManager().fileExistsAtPath(path, isDirectory:&nbsp;&amp;isDirectory)</font></div><div><font face="Menlo" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;!isDirectory&nbsp;else<br class="">&nbsp; &nbsp; &nbsp; &nbsp; {</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><font face="Menlo" class="">&nbsp; &nbsp; &nbsp;if&nbsp;let&nbsp;path&nbsp;=&nbsp;fileURL.path;&nbsp;NSFileManager.defaultManager().fileExistsAtPath(path) {<br class=""></font></div><div class=""><font face="Menlo" class=""><br class=""></font></div></div><div>To be clear, I’m not saying I prefer alamofire’s indentation style :-)</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div class="">My suggestion would be to reuse our normal &amp;&amp; operator:<br class=""><br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>guard<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>x == 0 &amp;&amp;<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>let y = optional &amp;&amp;<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>z == 2<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>else { ... }<br class=""><br class="">This would obviously be a built-in `&amp;&amp;` separate from our existing, infix operator `&amp;&amp;`. </div></div></blockquote><div><br class=""></div><div>Yes, this is technically feasible, but it has the opposite problem from the above: &amp;&amp; is very closely associated (in terms of programmer mindspace) with boolean conditionals, and the let/case clauses are *not* boolean conditions.</div><br class=""></div><div>-Chris</div><br class=""></body></html>