> Le 13 mai 2016 à 07:01, Chris Lattner via swift-evolution
> <[email protected]> a écrit :
>
> On May 12, 2016, at 4:50 PM, Joe Groff <[email protected]> wrote:
>>>> --- 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.
>
> I personally find that style repulsive :-) and I haven’t seen swift code
> commonly doing it. I’m not sure that we want to encourage it either.
Don't be too harsh :-) This style can be used with much profit when there are
several closure arguments:
foo(
x: {
// several lines of code
},
y: {
// several lines of code
}
)
For example:
https://github.com/groue/GRDBDemo/blob/cd8b9d5cadc3c6c66fd0da4869d820c6624fdf79/GRDBDemo/PersonsViewController.swift#L12-L44
Gwendal Roué
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution