[swift-evolution] [Proposal] Allow passing a variadic parameter to another variadic function

Christopher Boyd xpboyd at gmail.com
Fri May 20 11:29:58 CDT 2016


Vladimir,

True, but does the extra syntax actually accomplish anything?

>From my example:

   - func arithmeticMean(numbers: Double...) -> Double {
   - return add(numbers) / Double(numbers.count)
   - }


It's clear that the intent is to pass all the numbers to add().

What, exactly, does adding the #splat() syntax achieve?  It doesn't add any
additional clarity.

Moreover, I don't think #splat has been accepted as a proposal yet.

On Fri, May 20, 2016 at 12:19 PM Vladimir.S <svabox at gmail.com> wrote:

> [offtopic]
> On 20.05.2016 19:08, Christopher Boyd via swift-evolution wrote:
> > Certainly, #splat would work, but it may be slightly more confusing to
> > someone that hasn't seen the splat operator before:
> So, he/she will open swift documentation or drop the question to google
> once, and from that moment will know what #splat means.
> [/offtopic]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160520/9f39f5e9/attachment.html>


More information about the swift-evolution mailing list