> On 14 Feb 2017, at 20:43, Anton Zhilin via swift-evolution
> <[email protected]> wrote:
>
> 2017-02-14 18:32 GMT+03:00 Dimitri Racordon via swift-evolution
> <[email protected] <mailto:[email protected]>>:
>
>
>
> The proposal is indeed really interesting.
> I would love to see if it could get a second round of discussion.
>
> However, I failed to understand the syntax of the proposed extension. Where
> would be defined the label and parameter names? Is this just a typo?
>
> func someFunc<I:IteratorProtocol where I.Element == Int)
>
>
> “Obviously”, the Collection variant should look like:
>
> func someFunc<C: Collection where C.Iterator.Element == Int>(_ values:
> @variadic C) { … }
> And the others are analagous.
>
Thanks for the correction, not entirely sure how that mistake made it into the
proposal!
I didn't get an especially positive response to the proposal at the time, but
it is still very much my preferred solution.
"Splatting" as the OP suggests is a simpler solution, but leaves variadics
limited to a unique syntax with no control over type; I'm also not keen on
re-using ellipsis as an operator for it, since it's also used for handling
ranges, though that's not a major overlap. But still, part of why I made my
proposal is that splatting feels more like a workaround to a problem of there
not being a proper array/sequence/etc. signature for the function.
I could of course be biased, but then I've never really supported variadics as
a feature in the first place 😏
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution