<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 13, 2017, at 10:43 AM, Jarod Long 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="">
<title class=""></title>
<div class="">
<div name="messageBodySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;" class="">Ahh, yeah, that does seem like a much trickier case to avoid breaking. My instinct says it's still possible to avoid, but maybe not without lots of complexity.</div></div></div></blockquote><div><br class=""></div><div>We already have whitespace sensitive rules to handle this. There is no fundamental implementation difference that I see between separating the elements of lists (which are expressions) and the elements of statements (which can be expressions):</div><div><br class=""></div><div>func foo() -> Int { … }</div><div><br class=""></div><div>func statements() {</div><div> foo()</div><div> foo()</div><div>}</div><div><br class=""></div><div>let list = [</div><div> foo()</div><div> foo()</div><div>]</div><div><br class=""></div><div>That said, I still believe that it would be premature to "syntax optimize" this at this point in Swift’s evolution.</div><div><br class=""></div><div>-Chris</div><div><br class=""></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div class="">
<div name="messageSignatureSection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;" class=""><br class="">
Jarod</div>
<div name="messageReplySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;" class=""><br class="">
On Oct 12, 2017, 16:21 -0700, Xiaodi Wu <<a href="mailto:xiaodi.wu@gmail.com" class="">xiaodi.wu@gmail.com</a>>, wrote:<br class="">
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;" class="">
<div dir="ltr" class="">On Thu, Oct 12, 2017 at 2:47 PM, Jarod Long via swift-evolution <span dir="ltr" class=""><<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>></span> wrote:<br class="">
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #e67e22;">
<div class="">
<div name="messageBodySection" style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif" class="">I don't really expect this sort of syntactic sugar to be popular enough to make it through swift-evolution, and I don't think it's worth the distraction from more important priorities at this time, but for what it's worth, I've enjoyed this feature in other languages that support it. It plays a small part in making code more focused by eliminating unnecessary syntax.
<div class=""><br class=""></div>
<div class="">I could be wrong, but I'm not so sure that this would actually be source breaking. Even if you have something like this:</div>
<div class=""><br class=""></div>
<div class=""><font face="Monaco" class="">let points = [</font></div>
<div class=""><font face="Monaco" class=""> Point(</font></div>
<div class=""><font face="Monaco" class=""> x: 1.0,</font></div>
<div class=""><font face="Monaco" class=""> y: 2.0</font></div>
<div class=""><font face="Monaco" class=""> ),</font></div>
<div class=""><font face="Monaco" class=""> Point(</font></div>
<div class=""><font face="Monaco" class=""> x: 3.0,</font></div>
<div class=""><font face="Monaco" class=""> y: 4.0</font></div>
<div class=""><font face="Monaco" class=""> )</font></div>
<div class=""><font face="Monaco" class="">]</font></div>
<div class=""><br class=""></div>
<div class="">Proper implementation of this feature wouldn't suddenly interpret `Point(` as its own element.</div>
</div>
</div>
</blockquote>
<div class=""><br class=""></div>
<div class="">There are those of us who respect the 80-character line and break expressions across lines:</div>
<div class=""><br class=""></div>
<div class="">let x = [</div>
<div class=""> NSVeryVeryVeryLongType</div>
<div class=""> .veryVeryVeryLongProperty +</div>
<div class=""> NSVeryVeryVeryLongType2</div>
<div class=""> .veryVeryVeryLongProperty2,</div>
<div class="">]</div>
<div class=""><br class=""></div>
<div class="">It would be a pleasant surprise if a grammar with optional commas can avoid blowing up existing code; I'm quite doubtful.<br class=""></div>
<div class=""><br class=""></div>
<div class=""><br class=""></div>
<blockquote class="gmail_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #e67e22;">
<div class="">
<div class="">
<div class="gmail-h5">
<div name="messageReplySection" style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif" class="">On Oct 12, 2017, 12:23 -0700, Josh Parmenter via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>>, wrote:<br class="">
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #3498db;" class=""><br class="">
<br class="">
On Oct 12, 2017, at 12:17 PM, Kelvin Ma via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><<wbr class="">mailto:<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.<wbr class="">org</a>>> wrote:<br class="">
<br class="">
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 class="">
<br class="">
<br class="">
I very much agree^<br class="">
<br class="">
Josh<br class="">
<br class="">
<br class="">
<br class="">
Joshua Parmenter | Engineering Lead, Apple Technologies<br class="">
<br class="">
T <a href="tel:(248)%20777-7777" value="+12487777777" target="_blank" class="">248 777 7777</a><br class="">
C <a href="tel:(206)%20437-1551" value="+12064371551" target="_blank" class="">206 437 1551</a><br class="">
F <a href="tel:(248)%20616-1980" value="+12486161980" target="_blank" class="">248 616 1980</a><br class="">
<a href="http://www.vectorform.com/" target="_blank" class="">www.vectorform.com</a><<a href="http://www.vectorform.com/" target="_blank" class="">http://www.<wbr class="">vectorform.com/</a><br class="">
<br class="">
Vectorform<br class="">
2211 5th Ave Suite 201<br class="">
Seattle, WA 98121 USA<br class="">
<br class="">
Think Tank. Lab. Studio.<br class="">
We invent digital products and experiences.<br class="">
<br class="">
SEATTLE | DETROIT | NEW YORK | MUNICH | HYDERABAD<br class="">
______________________________<wbr class="">_________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/<wbr class="">mailman/listinfo/swift-<wbr class="">evolution</a><br class=""></blockquote>
</div>
</div>
</div>
</div>
<br class="">
______________________________<wbr class="">_________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/<wbr class="">mailman/listinfo/swift-<wbr class="">evolution</a><br class="">
<br class=""></blockquote>
</div>
<br class=""></div>
</div>
</blockquote>
</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>