<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 May 10, 2016, at 5:51 PM, Dany St-Amant 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 dir="auto" class=""><div class=""><br class=""></div><div class="">On May 10, 2016, at 4:57 PM, Rob Napier via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div dir="ltr" class="">On Tue, May 10, 2016 at 2:53 PM, Chris Lattner 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="">
* What is your evaluation of the proposal?<br class=""></blockquote><div class=""><br class=""></div><div class="">Trailing commas is clearly very useful in the collections case. While that case is more common than functions and tuples, I don't see any reason that collections should be treated as a special case. Why should some comma-separated lists allow trailing commas and some not?</div><div class=""><br class=""></div><div class="">This seems a reasonable move towards consistency and is useful in some cases while not harmful in others. When in doubt, I'd rather broad rules ("trailing commas are allowed in comma-separated lists") rather than special cases. This improves teachability.</div></div></div></div></div></blockquote><div class=""><br class=""></div>If one look purely at commas, the inconsistency may be hard to explain, but if one include the enclosing characters there are clear rules:<div class=""><br class=""></div><div class="">- within square brackets: trailing comma allowed</div><div class="">- within parenthesis: trailing comma not allowed</div><div class="">- within angle bracket: trailing comma not allowed</div></div></div></blockquote><div><br class=""></div><div>- within compound “conditions” (of while, if, guard): trailing comma not allowed</div><div><br class=""></div>-Chris</div><div><br class=""><blockquote type="cite" class=""><div class=""><div dir="auto" class=""><div class=""><br class=""></div><div class="">Weird, I do not recall anyone mentioning generics in the original trailing comma thread.</div><div class=""><br class=""></div><div class="">Dany</div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class=""></div><div class="">It also improves diffs when functions pick up new parameters, particularly ones with default values. This is particularly common (and expected) in constructors. That's valuable.</div><div class=""><br class=""></div><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
* Is the problem being addressed significant enough to warrant a change to Swift?<br class=""></blockquote><div class=""><br class=""></div><div class="">As a language rule simplification, I believe it's worth a change if it doesn't introduce problematic corner cases. The fact that it improves diffs is no less valuable for functions than it is for collections.</div><div class=""><br class=""></div><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
* Does this proposal fit well with the feel and direction of Swift?<br class=""></blockquote><div class=""><br class=""></div><div class="">Yes; it definitely feels Swifty in the same way that it does for collections. There's no reason for Swift to treat them differently.</div><div class=""><br class=""></div><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
* If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?<br class=""></blockquote><div class=""><br class=""></div><div class="">I've seen this in Perl, Python, and Go. Basically every language I've used that allows trailing commas in collections also allows them in function calls. In Go, the trailing comma is mandatory in some cases. This has been nice for consistency.</div><div class=""><br class=""></div><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
* How much effort did you put into your review? A glance, a quick reading, or an in-depth study?<br class=""></blockquote><div class=""><br class=""></div><div class="">Quick reading.</div><div class=""><br class=""></div><div class="">-Rob</div><div class=""><br class=""></div></div><div class="gmail_signature"><div dir="ltr" class=""><div class=""></div></div></div>
</div></div>
</div></blockquote><blockquote type="cite" class=""><div class=""><span class="">_______________________________________________</span><br class=""><span class="">swift-evolution mailing list</span><br class=""><span class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a></span><br class=""><span class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br class=""></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>