<div dir="ltr">a semicolon is a purely syntactic delimiter, the comma on the other hand corresponds to physical elements in a collection. I think the two are more different than you suggest.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 12, 2017 at 1:50 PM, Dave Yost via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div>Speaking as a huge fan of optional semicolons...</div><div><br></div><div><br></div><div>This seems clear:</div><div><br></div><span style="font-size:11px"><span style="background-color:white;font-family:Menlo">     semicolon : sequence of statements</span><br></span><div><font face="Menlo"><span style="background-color:white;font-size:11px">  :: comma     : sequence of elements in an array literal</span></font></div><div><br></div><div>and so it occurred to me that this should hold:</div><div><br></div><div><span style="font-size:11px;background-color:white;font-family:Menlo">     A semicolon : the last statement     on a line.</span></div><div><font face="Menlo"><span style="background-color:white;font-size:11px">  :: A comma     : the last array element on a line.</span></font></div><div><font face="Menlo"><span style="background-color:white;font-size:11px"><br></span></font></div><div><font face="Menlo"><span style="background-color:white;font-size:11px">  </span></font><span style="font-family:Menlo;font-size:11px;background-color:rgb(255,255,255)">∴  A </span><span style="font-family:Menlo;font-size:11px;background-color:rgb(255,255,255)">comma after the last array element on a line should be</span><span style="font-family:Menlo;font-size:11px;background-color:white"> optional.</span></div><div><br></div><div>and these should be legal Swift:</div><div><br></div><div><span style="font-size:11px"><span style="font-family:Menlo;background-color:rgb(255,255,255);color:rgb(172,172,172)">  let</span><span style="font-family:Menlo;background-color:rgb(255,255,255)"> list = [</span><br><span style="font-family:Menlo;background-color:rgb(255,255,255)">      </span><span style="font-family:Menlo;background-color:rgb(255,255,255);color:rgb(39,42,216)">1</span><br><span style="font-family:Menlo;background-color:rgb(255,255,255)">      </span><span style="font-family:Menlo;background-color:rgb(255,255,255);color:rgb(39,42,216)">2</span><br></span><div style="margin:0px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-size:11px">  ]</span></div></div><div><span style="font-size:11px"><br></span></div><div><span style="font-size:11px"><span style="font-family:Menlo;background-color:rgb(255,255,255);color:rgb(172,172,172)">  </span></span><span style="color:rgb(172,172,172);font-family:Menlo;font-size:11px;background-color:rgb(255,255,255)">let</span><span style="font-size:11px"><span style="font-family:Menlo;background-color:rgb(255,255,255)"> dict = [</span><br><span style="font-family:Menlo;background-color:rgb(255,255,255)">      </span><span style="font-family:Menlo;background-color:rgb(255,255,255);color:rgb(39,42,216)">1 : 2</span><br><span style="font-family:Menlo;background-color:rgb(255,255,255)">      </span><span style="font-family:Menlo;background-color:rgb(255,255,255);color:rgb(39,42,216)">2 : 3</span><br></span><div style="margin:0px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-size:11px">  ]</span></div></div><div><br></div><div>equivalent to:</div><div><br></div><div><div><span style="font-size:11px"><span style="font-family:Menlo;background-color:rgb(255,255,255);color:rgb(172,172,172)">  </span></span><span style="color:rgb(172,172,172);font-family:Menlo;font-size:11px;background-color:rgb(255,255,255)">let</span><span style="font-size:11px"><span style="font-family:Menlo;background-color:rgb(255,255,255)"> list = [ </span><span style="font-family:Menlo;background-color:rgb(255,255,255);color:rgb(39,42,216)">1, </span><span style="font-family:Menlo;background-color:rgb(255,255,255);color:rgb(39,42,216)">2 </span><span style="font-family:Menlo;background-color:rgb(255,255,255)">] ; </span></span><span style="color:rgb(172,172,172);font-family:Menlo;font-size:11px;background-color:rgb(255,255,255)">let</span><span style="font-size:11px"><span style="font-family:Menlo;background-color:rgb(255,255,255)"> dict = [ </span><span style="font-family:Menlo;background-color:rgb(255,255,255);color:rgb(39,42,216)">1 : 2, </span><span style="font-family:Menlo;background-color:rgb(255,255,255);color:rgb(39,42,216)">2 : 3 ]</span></span></div><div><div style="margin:0px;line-height:normal"><br></div></div></div><div style="margin:0px;line-height:normal"><br></div><div style="margin:0px;line-height:normal">Or, as the Language Reference would say:</div><div style="margin:0px;line-height:normal"><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div style="margin:0px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="color:rgb(65,65,65);font-family:Helvetica,Arial,sans-serif">A semicolon (</span><code class="m_-6361257529369476674code-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">) 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)"><br></div><div style="margin:0px;line-height:normal"><blockquote style="background-color:rgb(255,255,255);font-family:Optima;margin:0px 0px 0px 40px;border:none;padding:0px"><div style="margin:0px;line-height:normal;font-family:Menlo"><span style="color:rgb(65,65,65);font-family:Helvetica,Arial,sans-serif">A comma (</span><code class="m_-6361257529369476674code-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">) 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"><br></div><div style="margin:0px;line-height:normal">Or:</div><div style="margin:0px;line-height:normal"><div style="margin:0px;line-height:normal"><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style="margin:0px;line-height:normal"><span style="color:rgb(65,65,65);font-family:Helvetica,Arial,sans-serif">A semicolon (</span><code class="m_-6361257529369476674code-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">) separates statements but is optional</span><span style="color:rgb(65,65,65);font-family:Helvetica,Arial,sans-serif"> 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"><br></div><div style="background-color:rgb(255,255,255);margin:0px;line-height:normal"><blockquote style="font-family:Optima;margin:0px 0px 0px 40px;border:none;padding:0px"><div style="margin:0px;line-height:normal;font-family:Menlo"><span style="color:rgb(65,65,65);font-family:Helvetica,Arial,sans-serif">A comma (</span><code class="m_-6361257529369476674code-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">) separates elements of an array literal but is</span><span style="color:rgb(65,65,65);font-family:Helvetica,Arial,sans-serif"> optional after the last</span><span style="color:rgb(65,65,65);font-family:Helvetica,Arial,sans-serif"> element on a line.</span></div></blockquote><font color="#414141" face="Helvetica, Arial, sans-serif"><br></font></div><div style="background-color:rgb(255,255,255);margin:0px;line-height:normal"><font color="#414141" face="Helvetica, Arial, sans-serif"><span style="font-size:11.375px"><br></span></font></div></div></div></div><br>______________________________<wbr>_________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br>
<br></blockquote></div><br></div>