> On May 12, 2016, at 4:47 PM, Chris Lattner <[email protected]> wrote:
>
> On May 11, 2016, at 9:47 AM, Joe Groff <[email protected]> wrote:
>> +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,
>> )
>
> You’re arguing that you want to read Swift code written like this?
I wouldn't mind it. The standard library already uses this style for function
parameters, modulo the trailing comma, and I certainly prefer it to:
> --- a.swift
> +++ a.swift
> foo( x: 0
> , y: 1
> + , z: 2
> )
-Joe
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution