# Another attempt at passing arrays as varargs (with implementation)

**URL:** <https://forums.swift.org/t/another-attempt-at-passing-arrays-as-varargs-with-implementation/26718>\
**Category:** Pitches\
**Created:** [July 8, 2019, 2:54pm UTC](https://forums.swift.org/t/another-attempt-at-passing-arrays-as-varargs-with-implementation/26718 "2019-07-08T14:54:36Z")\
**Posts on this page:** 1\
**Showing post:** 98

<div class="post-metadata">

**Author:** ![clayellis](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/clayellis/32/43646_2.png) [@clayellis](https://forums.swift.org/u/clayellis)\
**Post date:** [July 18, 2019, 6:25pm UTC](https://forums.swift.org/t/another-attempt-at-passing-arrays-as-varargs-with-implementation/26718/98 "2019-07-18T18:25:11Z")

</div>

Given @dabrahams's feedback, specifically:

> [@dabrahams](#):
>
> The proposed syntax is specific to homogeneous collections (so wouldn’t apply to generic argument packs) and needlessly so: the compiler doesn’t need the element type to be restated just so it can explode the array.

It seems as if the `...` operator should be given another look. Reading through the [Variadic Generics](https://github.com/apple/swift/blob/master/docs/GenericsManifesto.md#variadic-generics) section in the Generics Manifesto and the `...` operator is called out specifically as a possible spelling for the feature.

> Variadic generics would allow us to abstract over a set of generic parameters. The syntax below is hopelessly influenced by [C++11 variadic templates](http://www.jot.fm/issues/issue_2008_02/article2/) (sorry), where putting an ellipsis ("...") to the left of a declaration makes it a "parameter pack" containing zero or more parameters and putting an ellipsis to the right of a type/expression/etc. expands the parameter packs within that type/expression into separate arguments. The important part is that we be able to meaningfully abstract over zero or more generic parameters...

It places the `...` operator before the type name, which falls out of alignment with the direction things were going in this thread. But! I came across this comment by Douglas later showing some preference to `...` as a suffix:

> [@Variadic Generics](https://forums.swift.org/t/variadic-generics/20320/13):
>
> sorta regret writing the example in that way. Swift shouldn't need the prefix "...", and that definition of `items` is probably wrong. If we're using "...", that example should likely be written as:
> 
> ```swift
> struct Variadic<T...> {
> var items: (T...)
> }
> 
> ```
> 
> Same thing here:
> 
> ![](https://global.discourse-cdn.com/swift/original/2X/7/7544beee32a91d5f0b0159b4236b013cfa0606af.png) technicated:
> 
> > var (...iterators): (Iterators...)
> 
> we don't need the prefix "...", and probably don't even want the notion of it in the language. `iterators` can be described as:
> 
> ```swift
> var iterators: (Iterators...)
> 
> ```

I think this is fuel enough to reconsider the spelling of this pitch's feature. The `...`operator (as a suffix) seems like a great way to package up all of Swift's variadic features.

---

_[View the full topic](https://forums.swift.org/t/another-attempt-at-passing-arrays-as-varargs-with-implementation/26718)._
