> On May 11, 2016, at 9:47 AM, Joe Groff via swift-evolution > <swift-evolution@swift.org> wrote: > >> >> On May 10, 2016, at 11:53 AM, Chris Lattner via swift-evolution >> <swift-evolution@swift.org> wrote: >> >> Hello Swift community, >> >> The review of "SE-0084: Allow trailing commas in parameter lists and tuples" >> begins now and runs through May 16. The proposal is available here: >> >> >> https://github.com/apple/swift-evolution/blob/master/proposals/0084-trailing-commas.md >> >> Reviews are an important part of the Swift evolution process. All reviews >> should be sent to the swift-evolution mailing list at >> >> https://lists.swift.org/mailman/listinfo/swift-evolution >> >> or, if you would like to keep your feedback private, directly to the review >> manager. >> >> What goes into a review? >> >> The goal of the review process is to improve the proposal under review >> through constructive criticism and contribute to the direction of Swift. >> When writing your review, here are some questions you might want to answer >> in your review: >> >> * What is your evaluation of the proposal? >> * Is the problem being addressed significant enough to warrant a change >> to Swift? >> * Does this proposal fit well with the feel and direction of Swift? >> * If you have used other languages or libraries with a similar feature, >> how do you feel that this proposal compares to those? >> * How much effort did you put into your review? A glance, a quick >> reading, or an in-depth study? >> >> More information about the Swift evolution process is available at >> >> https://github.com/apple/swift-evolution/blob/master/process.md >> >> Thank you, >> >> -Chris Lattner >> Review Manager > > +1 from me. We should be consistent in either accepting or rejecting trailing > commas everywhere we have comma-delimited syntax. I'm in favor of accepting > it, since it's popular in languages where it's supported to enable a > minimal-diff style, so that changes to code don't impact neighboring lines > for purely syntactic reasons. If you add an argument to a function, without > trailing comma support, a comma has to be added to dirty the previous line: > > --- a.swift > +++ a.swift > foo( > x: 0, > - y: 1 > + y: 1, > + z: 2 > ) > > Trailing commas avoid this: > > --- a.swift > +++ a.swift > foo( > x: 0, > y: 1, > + z: 2, > ) > > > In languages that don't support trailing commas, many users resort to the > abomination of leading-comma style, strangely popular in Haskell and related > languages: > > --- a.swift > +++ a.swift > foo( x: 0 > , y: 1 > + , z: 2 > ) > > I think the trailing-comma syntax jives much better with Swift style.
In response to observations that tuples and function arguments are somehow different from collection literals because they generally have fixed arity, I'll note that we have an very prominent variadic function in the standard library, "print", and that adding or removing values to a "print" is a very common and natural thing to do. -Joe _______________________________________________ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution