<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="">Hi Dave,</div><div class=""><br class=""></div><div class="">I agree with you that this is an analogous technical problem to semicolon inference, and that Swift has a well developed solution for it which would probably work well enough.</div><div class=""><br class=""></div><div class="">That said, this is a pure sugar proposal, one which can make future evolution more difficult. Getting this into Swift 5 will be very very difficult to justify, even if the community somehow agreed that it was the right thing to do. It is just the conservatively correct default to say “no” to these sorts of changes now, because there are other bigger moving pieces that have to be sorted first.</div><div class=""><br class=""></div><div class="">-Chris</div><div class=""><br class=""></div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 12, 2017, at 11:50 AM, Dave Yost via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> 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=""><div class=""><br class=""></div><div class="">Speaking as a huge fan of optional semicolons...</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">This seems clear:</div><div class=""><br class=""></div><span style="font-size: 11px;" class=""><span style="background-color: white; font-family: Menlo;" class=""> semicolon : sequence of statements</span><br class=""></span><div class=""><font face="Menlo" class=""><span style="background-color: white; font-size: 11px;" class=""> :: comma : sequence of elements in an array literal</span></font></div><div class=""><br class=""></div><div class="">and so it occurred to me that this should hold:</div><div class=""><br class=""></div><div class=""><span style="font-size: 11px; background-color: white; font-family: Menlo;" class=""> A semicolon : the last statement on a line.</span></div><div class=""><font face="Menlo" class=""><span style="background-color: white; font-size: 11px;" class=""> :: A comma : the last array element on a line.</span></font></div><div class=""><font face="Menlo" class=""><span style="background-color: white; font-size: 11px;" class=""><br class=""></span></font></div><div class=""><font face="Menlo" class=""><span style="background-color: white; font-size: 11px;" class=""> </span></font><span style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class="">∴ A </span><span style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class="">comma after the last array element on a line should be</span><span style="font-family: Menlo; font-size: 11px; background-color: white;" class=""> optional.</span></div><div class=""><br class=""></div><div class="">and these should be legal Swift:</div><div class=""><br class=""></div><div class=""><span style="font-size: 11px;" class=""><span style="font-family: Menlo; background-color: rgb(255, 255, 255); color: rgb(172, 172, 172);" class=""> let</span><span style="font-family: Menlo; background-color: rgb(255, 255, 255);" class=""> list = [</span><br class=""><span style="font-family: Menlo; background-color: rgb(255, 255, 255);" class=""> </span><span style="font-family: Menlo; background-color: rgb(255, 255, 255); color: rgb(39, 42, 216);" class="">1</span><br class=""><span style="font-family: Menlo; background-color: rgb(255, 255, 255);" class=""> </span><span style="font-family: Menlo; background-color: rgb(255, 255, 255); color: rgb(39, 42, 216);" class="">2</span><br class=""></span><div style="margin: 0px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-size: 11px;" class=""> ]</span></div></div><div class=""><span style="font-size: 11px;" class=""><br class=""></span></div><div class=""><span style="font-size: 11px;" class=""><span style="font-family: Menlo; background-color: rgb(255, 255, 255); color: rgb(172, 172, 172);" class=""> </span></span><span style="color: rgb(172, 172, 172); font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class="">let</span><span style="font-size: 11px;" class=""><span style="font-family: Menlo; background-color: rgb(255, 255, 255);" class=""> dict = [</span><br class=""><span style="font-family: Menlo; background-color: rgb(255, 255, 255);" class=""> </span><span style="font-family: Menlo; background-color: rgb(255, 255, 255); color: rgb(39, 42, 216);" class="">1 : 2</span><br class=""><span style="font-family: Menlo; background-color: rgb(255, 255, 255);" class=""> </span><span style="font-family: Menlo; background-color: rgb(255, 255, 255); color: rgb(39, 42, 216);" class="">2 : 3</span><br class=""></span><div style="margin: 0px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-size: 11px;" class=""> ]</span></div></div><div class=""><br class=""></div><div class="">equivalent to:</div><div class=""><br class=""></div><div class=""><div class=""><span style="font-size: 11px;" class=""><span style="font-family: Menlo; background-color: rgb(255, 255, 255); color: rgb(172, 172, 172);" class=""> </span></span><span style="color: rgb(172, 172, 172); font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class="">let</span><span style="font-size: 11px;" class=""><span style="font-family: Menlo; background-color: rgb(255, 255, 255);" class=""> list = [ </span><span style="font-family: Menlo; background-color: rgb(255, 255, 255); color: rgb(39, 42, 216);" class="">1, </span><span style="font-family: Menlo; background-color: rgb(255, 255, 255); color: rgb(39, 42, 216);" class="">2 </span><span style="font-family: Menlo; background-color: rgb(255, 255, 255);" class="">] ; </span></span><span style="color: rgb(172, 172, 172); font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);" class="">let</span><span style="font-size: 11px;" class=""><span style="font-family: Menlo; background-color: rgb(255, 255, 255);" class=""> dict = [ </span><span style="font-family: Menlo; background-color: rgb(255, 255, 255); color: rgb(39, 42, 216);" class="">1 : 2, </span><span style="font-family: Menlo; background-color: rgb(255, 255, 255); color: rgb(39, 42, 216);" class="">2 : 3 ]</span></span></div><div class=""><div style="margin: 0px; line-height: normal;" class=""><br class=""></div></div></div><div style="margin: 0px; line-height: normal;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class="">Or, as the Language Reference would say:</div><div style="margin: 0px; line-height: normal;" class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div style="margin: 0px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(65, 65, 65); font-family: Helvetica, Arial, sans-serif;" class="">A semicolon (</span><code class="code-voice" style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(128, 128, 128); font-family: Menlo, monospace; word-wrap: break-word;">;</code><span style="color: rgb(65, 65, 65); font-family: Helvetica, Arial, sans-serif;" class="">) can optionally appear after any statement and is used to separate multiple statements if they appear on the same line.</span></div></blockquote><div style="margin: 0px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><blockquote style="background-color: rgb(255, 255, 255); font-family: Optima; margin: 0px 0px 0px 40px; border: none; padding: 0px;" class=""><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="color: rgb(65, 65, 65); font-family: Helvetica, Arial, sans-serif;" class="">A comma (</span><code class="code-voice" style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(128, 128, 128); font-family: Menlo, monospace; word-wrap: break-word;">,</code><span style="color: rgb(65, 65, 65); font-family: Helvetica, Arial, sans-serif;" class="">) can optionally appear after any element of an array literal and is used to separate multiple elements if they appear on the same line.</span></div></blockquote><div style="margin: 0px; line-height: normal;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class="">Or:</div><div style="margin: 0px; line-height: normal;" class=""><div style="margin: 0px; line-height: normal;" class=""><br class=""></div><blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="color: rgb(65, 65, 65); font-family: Helvetica, Arial, sans-serif;" class="">A semicolon (</span><code class="code-voice" style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(128, 128, 128); font-family: Menlo, monospace; word-wrap: break-word;">;</code><span style="color: rgb(65, 65, 65); font-family: Helvetica, Arial, sans-serif;" class="">) separates statements but is optional</span><span style="color: rgb(65, 65, 65); font-family: Helvetica, Arial, sans-serif;" class=""> after the last statement on a line.</span></div></blockquote><div style="background-color: rgb(255, 255, 255); font-family: Menlo; margin: 0px; line-height: normal;" class=""><br class=""></div><div style="background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;" class=""><blockquote style="font-family: Optima; margin: 0px 0px 0px 40px; border: none; padding: 0px;" class=""><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="color: rgb(65, 65, 65); font-family: Helvetica, Arial, sans-serif;" class="">A comma (</span><code class="code-voice" style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(128, 128, 128); font-family: Menlo, monospace; word-wrap: break-word;">,</code><span style="color: rgb(65, 65, 65); font-family: Helvetica, Arial, sans-serif;" class="">) separates elements of an array literal but is</span><span style="color: rgb(65, 65, 65); font-family: Helvetica, Arial, sans-serif;" class=""> optional after the last</span><span style="color: rgb(65, 65, 65); font-family: Helvetica, Arial, sans-serif;" class=""> element on a line.</span></div></blockquote><font color="#414141" face="Helvetica, Arial, sans-serif" class=""><br class=""></font></div><div style="background-color: rgb(255, 255, 255); margin: 0px; line-height: normal;" class=""><font color="#414141" face="Helvetica, Arial, sans-serif" class=""><span style="font-size: 11.375px;" class=""><br class=""></span></font></div></div></div></div>_______________________________________________<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></blockquote></div><br class=""></body></html>