[swift-evolution] Allowing trailing commas in argument lists

Ted F.A. van Gaalen tedvgiosdev at gmail.com
Wed Mar 9 08:44:11 CST 2016


Hi Paul

I don’t think that is a good idea because:

as in most human languages writing,
the comma tells us,
that more is following,
?
?
.. oops. hey, no more text?   

So, to me your examples are incomplete statements,
leading to mistakes when editing, me assuming that I
didn’t finish typing the statement, when I started
editing the source say, three months later.
or, doing maintenance and having to fast-read through
many old source files.

Is it really so hard to press the DEL key to remove
the trailing comma?

Greetings,
TedvG ,



(sorry no more text here :0)






> 
> Right now, Swift argument lists are not permitted to contain trailing commas. To make multi-line calls easier, we propose allowing trailing commas in argument (and tuple) syntax:
> 
>    let person = Person(
>       id: json['id'],
>       name: json['name'],
>       picture: Im2age(picture),
>       friends: friends,
>    )


More information about the swift-evolution mailing list