[swift-evolution] [Review] SE-0084: Allow trailing commas in parameter lists and tuples

Joe Groff jgroff at apple.com
Fri May 13 12:32:34 CDT 2016


> On May 13, 2016, at 7:32 AM, Matthew Johnson via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
> 
> Sent from my iPad
> 
>> On May 13, 2016, at 9:19 AM, Vladimir.S <svabox at gmail.com> wrote:
>> 
>>> On 13.05.2016 16:32, Matthew Johnson wrote:
>>> I am, +1 on allowing new lines instead of commas.  I suggest you pursue a proposal on that.
>> 
>> Unfortunately I have no ability for this right now, so someone who is interested in this could take the idea and create a 'formal' proposal.
>> 
>>> 
>>> I am also +1 on the current proposal because it exists and will be pretty useful in some cases and I can't predict how long it might be until such a new line proposal would be approved.  I also think that the choice between them should be a style choice, not one made by the language (as with semicolon) and if anyone chooses commas they should have the utility of the current proposal available to them.
>> 
>> Don't you feel like this proposal(SE-0084) should be extended to list of generic types at least, or even to allow trailing comma in any comma-separated list in Swift? I.e. you are saying +1, but probably the exact proposal should be improved to have your +1.
> 
> I have no opinion on that.  I don't object to it being done in the name of consistency but can't think of any actual use cases either.
>> 
>> Probably (if this is allowed) the author of this proposal (SE-0084) can add 'line-break separator feature' to his/her proposal and generalize the rule of trailing comma/line-breaks for any comma-separated list in Swift?
> 
> That feels like a separate proposal to me.

I agree, allowing commas to be elided at line breaks is an interesting direction that deserves its own discussion. One problem that immediately comes to my mind is commas in generic parameter lists. If commas aren't required in generic parameter lists, it becomes even more challenging to disambiguate with less-than/greater-than expressions at top level, compromising our ability to shed `.self` for this purpose.

-Joe

>> 
>> As I can see, the proposal SE-0084 'per se' has more negative comments than positive(even if some from @apple.com supports it) and I feel like extended proposal can have more support.
>> 
>>> 
>>> Sent from my iPad
>>> 
>>>> On May 13, 2016, at 1:24 AM, Vladimir.S via swift-evolution <swift-evolution at swift.org> wrote:
>>>> 
>>>> IMO If we were *really* concerned about this, we should just allow line-break as separator in comma-separated lists.
>>>> 
>>>>> On 13.05.2016 8:01, Chris Lattner via swift-evolution wrote:
>>>>> If we were really concerned about this, a narrower way to solve the same problem would be to allow a comma before the ), but *only* when there is a newline between them.  I still don’t see why we’d want to encourage this though.
>>>> _______________________________________________
>>>> swift-evolution mailing list
>>>> swift-evolution at swift.org
>>>> https://lists.swift.org/mailman/listinfo/swift-evolution
>>> 
>>> 
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution



More information about the swift-evolution mailing list