[swift-evolution] [Review] SE-0084: Allow trailing commas in parameter lists and tuples
Joe Groff
jgroff at apple.com
Wed May 11 11:47:57 CDT 2016
> On May 10, 2016, at 11:53 AM, Chris Lattner via swift-evolution <swift-evolution at 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.
-Joe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160511/1d89327a/attachment.html>
More information about the swift-evolution
mailing list