<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 15 Feb 2017, at 12:16, Adrian Zubarev &lt;<a href="mailto:adrian.zubarev@devandartist.com" class="">adrian.zubarev@devandartist.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="bloop_markdown" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);"><p style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">I gave the topic a down vote not because I don’t like the proposal, but because I personally see variadics go into the direction of tuples. Especially I’d love to see some more talk about tuples in combination of generic variadics (see here:&nbsp;<a href="https://github.com/apple/swift/blob/master/docs/GenericsManifesto.md#variadic-generics" class="" style="color: rgb(65, 131, 196); text-decoration: none; -webkit-margin-before: 0px;">https://github.com/apple/swift/blob/master/docs/GenericsManifesto.md#variadic-generics</a>).</p><p style="margin: 15px 0px;" class="">There is a lot of design overlap. That is the reason why I think we should vision variadics as a whole in its future rather than simply repaint<span class="Apple-converted-space">&nbsp;</span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;" class="">…</code><span class="Apple-converted-space">&nbsp;</span>postfix to a type annotation keyword<span class="Apple-converted-space">&nbsp;</span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">@variadics</code>. This will only close the doors for some features we might want to add in a future version of Swift.</p></div></div></blockquote><div>This seems like an entirely separate feature to me; unless the intention is to go back to the old style of treating function arguments as a tuple I don't see why they should need to be related?</div><div><br class=""></div><div>Variable-width tuples would still be compiled down to fixed widths at some point (based on the number of types you pass).</div><div>Variadic functions however are just syntactic sugar for passing an array, currently minus the ability to actually pass an array.</div><div><br class=""></div><div>I don't think they're similar at all; repurposing of ellipsis to variadic generics/tuples isn't something I'm opposed to (though I still don't like the ambiguity with ranges), because to me it doesn't seem like an overlapping feature at all.</div><div><br class=""></div><div>Put another way; variadic generics is a way to allow developers to specify multiple types and arbitrary-width tuples, variadic functions just let developers call a method without using square braces. Why does the latter warrant a unique syntax that effectively creates a special class of function lacking the ability to specify collection type?</div><br class=""><blockquote type="cite" class=""><div class="bloop_original_html" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);">Am 15. Februar 2017 um 12:43:49, Haravikk via swift-evolution (<a href="mailto:swift-evolution@swift.org" class="" style="color: rgb(65, 131, 196); text-decoration: none;">swift-evolution@swift.org</a>) schrieb:<br class=""><blockquote type="cite" class="clean_bq" style="margin: 15px 0px;"><span style="margin-top: 0px; margin-bottom: 0px;" class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""></div><div class=""><div class="">Immediate followup, but is there something wrong with the gmane site that we've been using to provide links to mailing list discussions?</div><div class="">I can't seem to get a list of recent topics so I can find out what the new discussion link should be.</div><br class=""><div class=""><blockquote type="cite" class="" style="margin: 15px 0px;"><div class="" style="margin-top: 0px;">On 15 Feb 2017, at 11:38, Haravikk via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class="" style="margin-bottom: 0px;"><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">I'm posting this as a new discussion topic for my earlier proposal of Variadics as an Attribute. I would have reused the old topic but I have no idea how to do that on a mailing list once the messages are gone (I don't keep them for long); I'm looking forward to the possible switch to Discourse!<div class=""><br class=""></div><div class="">The idea behind the proposal is fairly simple; to do away with the current unique syntax for declaring variadic functions/methods, while retaining the ability to call methods in the same way. In other words, instead of declaring a method with an ellipsis, you would declare it just like any other method, but add the @variadic attribute, enabling the ability to call it just like you would call a variadic now.</div><div class=""><br class=""></div><div class="">Since this isn't strictly a code-breaking change (existing code can be converted automatically) I'm unsure of when to issue a new pull request, so I'll stick with a discussion to hammer out any lingering issues with the proposal for just now. Here it is:</div><div class=""><br class=""></div><div class=""><a href="https://github.com/Haravikk/swift-evolution/blob/1d3c09f1c6f3e6dc502ef84538d197a02bed904e/proposals/nnnn-variadics-as-attribute.md" class="" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;">https://github.com/Haravikk/swift-evolution/blob/1d3c09f1c6f3e6dc502ef84538d197a02bed904e/proposals/nnnn-variadics-as-attribute.md</a></div><div class=""><br class=""></div><div class=""><h1 class="" style="font-weight: bold; color: rgb(51, 51, 51); font-size: 28pt; box-sizing: border-box; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.25; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255); margin-top: 0px !important;">Variadics as Attribute</h1><h1 class="" style="font-weight: bold; color: rgb(51, 51, 51); font-size: 28pt; box-sizing: border-box; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.25; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255); margin-top: 0px !important;"></h1><ul class="" style="margin: 0px 0px 16px; box-sizing: border-box; padding-left: 2em; font-size: 16px; font-weight: normal;"><li class="" style="margin: 15px 0px; box-sizing: border-box;">Proposal:&nbsp;<a href="https://github.com/Haravikk/swift-evolution/blob/master/proposals/nnnn-variadics-as-attribute.md" class="" style="color: rgb(64, 120, 192); background-color: transparent; text-decoration: none; box-sizing: border-box; -webkit-text-decoration-skip: objects;">SE-NNNN</a></li><li class="" style="margin: 0.25em 0px 15px; box-sizing: border-box;">Author:&nbsp;<a href="https://github.com/haravikk" class="" style="color: rgb(64, 120, 192); background-color: transparent; text-decoration: none; box-sizing: border-box; -webkit-text-decoration-skip: objects;">Haravikk</a></li><li class="" style="margin: 0.25em 0px 15px; box-sizing: border-box;">Status:&nbsp;<span class="" style="box-sizing: border-box; font-weight: 600;">Awaiting review</span></li><li class="" style="margin: 0.25em 0px 15px; box-sizing: border-box;">Review manager: TBD</li></ul><h2 class="" style="font-weight: bold; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); color: rgb(51, 51, 51); font-size: 24px; box-sizing: border-box; margin-top: 24px; margin-bottom: 16px; line-height: 1.25; padding-bottom: 0.3em; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255);"><a id="user-content-introduction" class="anchor" href="https://github.com/Haravikk/swift-evolution/blob/master/proposals/nnnn-variadics-as-attribute.md#introduction" aria-hidden="true" style="color: rgb(64, 120, 192); background-color: transparent; text-decoration: none; box-sizing: border-box; -webkit-text-decoration-skip: objects; float: left; padding-right: 4px; margin-left: -20px; line-height: 1;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Introduction</h2><h1 class="" style="font-weight: bold; color: rgb(51, 51, 51); font-size: 28pt; box-sizing: border-box; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.25; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255); margin-top: 0px !important;"></h1><p class="" style="margin: 0px 0px 16px; box-sizing: border-box; font-size: 16px; font-weight: normal;">This proposal seeks to redesign the current, unique variadic function declaration syntax to use an attribute instead, with a goal of unifying standard and variadic function declarations.</p><h2 class="" style="font-weight: bold; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); color: rgb(51, 51, 51); font-size: 24px; box-sizing: border-box; margin-top: 24px; margin-bottom: 16px; line-height: 1.25; padding-bottom: 0.3em; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255);"><a id="user-content-motivation" class="anchor" href="https://github.com/Haravikk/swift-evolution/blob/master/proposals/nnnn-variadics-as-attribute.md#motivation" aria-hidden="true" style="color: rgb(64, 120, 192); background-color: transparent; text-decoration: none; box-sizing: border-box; -webkit-text-decoration-skip: objects; float: left; padding-right: 4px; margin-left: -20px; line-height: 1;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Motivation</h2><h1 class="" style="font-weight: bold; color: rgb(51, 51, 51); font-size: 28pt; box-sizing: border-box; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.25; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255); margin-top: 0px !important;"></h1><p class="" style="margin: 0px 0px 16px; box-sizing: border-box; font-size: 16px; font-weight: normal;">Variadics are essentially a call-site feature enabling a function to be called as if it is being provided with multiple arguments, rather than a single list argument. However instead of being implemented as some kind of switch, variadics have a unique declaration syntax that separates them uncessarily from standard function declarations. Currently this also means that redundancy is required in order to allow a function to be called both with an explicit array, and in the variadic style.</p><h2 class="" style="font-weight: bold; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); color: rgb(51, 51, 51); font-size: 24px; box-sizing: border-box; margin-top: 24px; margin-bottom: 16px; line-height: 1.25; padding-bottom: 0.3em; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255);"><a id="user-content-proposed-solution" class="anchor" href="https://github.com/Haravikk/swift-evolution/blob/master/proposals/nnnn-variadics-as-attribute.md#proposed-solution" aria-hidden="true" style="color: rgb(64, 120, 192); background-color: transparent; text-decoration: none; box-sizing: border-box; -webkit-text-decoration-skip: objects; float: left; padding-right: 4px; margin-left: -20px; line-height: 1;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Proposed solution</h2><h1 class="" style="font-weight: bold; color: rgb(51, 51, 51); font-size: 28pt; box-sizing: border-box; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.25; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255); margin-top: 0px !important;"></h1><p class="" style="margin: 0px 0px 16px; box-sizing: border-box; font-size: 16px; font-weight: normal;">To unify both regular and variadic function declarations this proposal seeks to replace the unique trailing elipsis declaration syntax with a new&nbsp;<code class="" style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgba(0, 0, 0, 0.0392157); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px; padding: 0.2em 0px; word-break: normal; word-wrap: normal; box-sizing: border-box;">@variadic</code>&nbsp;attribute on regular function declarations, enabling optional variadic syntax at the call site.</p><p class="" style="margin: 0px 0px 16px; box-sizing: border-box; font-size: 16px; font-weight: normal;">In short this proposal would replace:</p><pre class="" style="margin: 0px 0px 16px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(247, 247, 247); color: inherit; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 16px; word-break: normal; word-wrap: normal; box-sizing: border-box; font-weight: normal; line-height: 1.45;"><code class="" style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; color: inherit; border: 0px; margin: 0px; padding: 0px; word-break: normal; word-wrap: normal; box-sizing: border-box; display: inline; overflow: visible; line-height: inherit;">func someFunc(_ values:Int...) { … }
</code></pre><p class="" style="margin: 0px 0px 16px; box-sizing: border-box; font-size: 16px; font-weight: normal;">With the following:</p><pre class="" style="margin: 0px 0px 16px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(247, 247, 247); color: inherit; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 16px; word-break: normal; word-wrap: normal; box-sizing: border-box; font-weight: normal; line-height: 1.45;"><code class="" style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; color: inherit; border: 0px; margin: 0px; padding: 0px; word-break: normal; word-wrap: normal; box-sizing: border-box; display: inline; overflow: visible; line-height: inherit;">func someFunc(_ values:@variadic [Int]) { … }
</code></pre><h2 class="" style="font-weight: bold; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); color: rgb(51, 51, 51); font-size: 24px; box-sizing: border-box; margin-top: 24px; margin-bottom: 16px; line-height: 1.25; padding-bottom: 0.3em; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255);"><a id="user-content-detailed-design" class="anchor" href="https://github.com/Haravikk/swift-evolution/blob/master/proposals/nnnn-variadics-as-attribute.md#detailed-design" aria-hidden="true" style="color: rgb(64, 120, 192); background-color: transparent; text-decoration: none; box-sizing: border-box; -webkit-text-decoration-skip: objects; float: left; padding-right: 4px; margin-left: -20px; line-height: 1;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Detailed design</h2><h1 class="" style="font-weight: bold; color: rgb(51, 51, 51); font-size: 28pt; box-sizing: border-box; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.25; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255); margin-top: 0px !important;"></h1><p class="" style="margin: 0px 0px 16px; box-sizing: border-box; font-size: 16px; font-weight: normal;">The trailing elipsis declaration syntax will be removed, with a fixit providing a replacement to the new attribute-based syntax. The new&nbsp;<code class="" style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgba(0, 0, 0, 0.0392157); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px; padding: 0.2em 0px; word-break: normal; word-wrap: normal; box-sizing: border-box;">@variadic</code>&nbsp;attribute can be placed on any one function parameter with a type of&nbsp;<code class="" style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgba(0, 0, 0, 0.0392157); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px; padding: 0.2em 0px; word-break: normal; word-wrap: normal; box-sizing: border-box;">Array&lt;Foo&gt;</code>&nbsp;(or&nbsp;<code class="" style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgba(0, 0, 0, 0.0392157); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px; padding: 0.2em 0px; word-break: normal; word-wrap: normal; box-sizing: border-box;">[Foo]</code>), enabling the optional use of variadic declaration at the call site.</p><p class="" style="margin: 0px 0px 16px; box-sizing: border-box; font-size: 16px; font-weight: normal;">For example:</p><pre class="" style="margin: 0px 0px 16px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(247, 247, 247); color: inherit; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 16px; word-break: normal; word-wrap: normal; box-sizing: border-box; font-weight: normal; line-height: 1.45;"><code class="" style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; color: inherit; border: 0px; margin: 0px; padding: 0px; word-break: normal; word-wrap: normal; box-sizing: border-box; display: inline; overflow: visible; line-height: inherit;">func someFunc(_ values:@variadic [Int]) { … }
</code></pre><p class="" style="margin: 0px 0px 16px; box-sizing: border-box; font-size: 16px; font-weight: normal;">Can be called in any of the following forms:</p><pre class="" style="margin: 0px 0px 16px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(247, 247, 247); color: inherit; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 16px; word-break: normal; word-wrap: normal; box-sizing: border-box; font-weight: normal; line-height: 1.45;"><code class="" style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; color: inherit; border: 0px; margin: 0px; padding: 0px; word-break: normal; word-wrap: normal; box-sizing: border-box; display: inline; overflow: visible; line-height: inherit;">someFunc(1, 2, 3, 4, 5)   // Fixed length variadic call
someFunc([1, 2, 3, 4, 5]) // Fixed length array call
someFunc(foo)             // Dynamic array call passing the Array variable foo
</code></pre><h3 class="" style="font-weight: bold; font-size: 1.25em; box-sizing: border-box; margin-top: 24px; margin-bottom: 16px; line-height: 1.25; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255);"><a id="user-content-advantages" class="anchor" href="https://github.com/Haravikk/swift-evolution/blob/master/proposals/nnnn-variadics-as-attribute.md#advantages" aria-hidden="true" style="color: rgb(64, 120, 192); background-color: transparent; text-decoration: none; box-sizing: border-box; -webkit-text-decoration-skip: objects; float: left; padding-right: 4px; margin-left: -20px; line-height: 1;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Advantages</h3><h1 class="" style="font-weight: bold; color: rgb(51, 51, 51); font-size: 28pt; box-sizing: border-box; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.25; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255); margin-top: 0px !important;"></h1><ol class="" style="margin: 0px 0px 16px; box-sizing: border-box; padding-left: 2em; font-size: 16px; font-weight: normal;"><li class="" style="margin: 15px 0px; box-sizing: border-box;">Unifies standard and variadic function declarations, eliminating a unique syntax that is arguably unnecessary.</li><li class="" style="margin: 0.25em 0px 15px; box-sizing: border-box;">The type of the variadic parameter is absolutely explicit.</li><li class="" style="margin: 0.25em 0px 15px; box-sizing: border-box;">Enables calling of a variadic function with dynamic arrays, without the need for additional special syntax.</li><li class="" style="margin: 0.25em 0px 15px; box-sizing: border-box;">No redundant overloads to enable both call styles (one declaration provides both).</li><li class="" style="margin: 0.25em 0px 15px; box-sizing: border-box;">Enables further extension to support more collection types now or in future (see Proposed Extension below).</li><li class="" style="margin: 0.25em 0px 15px; box-sizing: border-box;">Moves the variadic feature declaration from syntax into the attributes list, which should aid discoverability (and simplify syntax very slightly).</li><li class="" style="margin: 0.25em 0px 15px; box-sizing: border-box;">The attribute is more explicit about what it does (provides a name that can be searched).</li></ol><h3 class="" style="font-weight: bold; font-size: 1.25em; box-sizing: border-box; margin-top: 24px; margin-bottom: 16px; line-height: 1.25; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255);"><a id="user-content-ambiguity" class="anchor" href="https://github.com/Haravikk/swift-evolution/blob/master/proposals/nnnn-variadics-as-attribute.md#ambiguity" aria-hidden="true" style="color: rgb(64, 120, 192); background-color: transparent; text-decoration: none; box-sizing: border-box; -webkit-text-decoration-skip: objects; float: left; padding-right: 4px; margin-left: -20px; line-height: 1;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Ambiguity</h3><h1 class="" style="font-weight: bold; color: rgb(51, 51, 51); font-size: 28pt; box-sizing: border-box; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.25; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255); margin-top: 0px !important;"></h1><p class="" style="margin: 0px 0px 16px; box-sizing: border-box; font-size: 16px; font-weight: normal;">One technical issue with this change is the introduction of ambiguity as follows:</p><pre class="" style="margin: 0px 0px 16px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(247, 247, 247); color: inherit; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 16px; word-break: normal; word-wrap: normal; box-sizing: border-box; font-weight: normal; line-height: 1.45;"><code class="" style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; color: inherit; border: 0px; margin: 0px; padding: 0px; word-break: normal; word-wrap: normal; box-sizing: border-box; display: inline; overflow: visible; line-height: inherit;">someFunc(_ values:@variadic [Any]) { … }
someFunc([1]) // Is this an array call of [1] or a variadic call of [[1]]?
someFunc(foo) // If foo is an array, is this an array call of foo, or a variadic call of [foo]?
</code></pre><p class="" style="margin: 0px 0px 16px; box-sizing: border-box; font-size: 16px; font-weight: normal;">However, this issue is only exhibited when the type of variadic is&nbsp;<code class="" style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgba(0, 0, 0, 0.0392157); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px; padding: 0.2em 0px; word-break: normal; word-wrap: normal; box-sizing: border-box;">Any</code>&nbsp;(or another type that can represent both an array of elements and the elements themselves) and only when there is possibly only a single argument.</p><p class="" style="margin: 0px 0px 16px; box-sizing: border-box; font-size: 16px; font-weight: normal;">The proposed solution to this is to reuse the new&nbsp;<code class="" style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgba(0, 0, 0, 0.0392157); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px; padding: 0.2em 0px; word-break: normal; word-wrap: normal; box-sizing: border-box;">@variadic</code>&nbsp;attribute, plus a&nbsp;<code class="" style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgba(0, 0, 0, 0.0392157); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px; padding: 0.2em 0px; word-break: normal; word-wrap: normal; box-sizing: border-box;">@nonVariadic</code>&nbsp;attribute*, enabling disambiguation like so:</p><pre class="" style="margin: 0px 0px 16px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(247, 247, 247); color: inherit; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 16px; word-break: normal; word-wrap: normal; box-sizing: border-box; font-weight: normal; line-height: 1.45;"><code class="" style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; color: inherit; border: 0px; margin: 0px; padding: 0px; word-break: normal; word-wrap: normal; box-sizing: border-box; display: inline; overflow: visible; line-height: inherit;">someFunc(@variadic [1])     // Unambiguously a variadic call of [[1]]
someFunc(@nonVariadic [1])  // Unambiguously an array call of [1]
someFunc(@variadic foo)     // Unambiguously a variadic call of [foo]
</code></pre><p class="" style="margin: 0px 0px 16px; box-sizing: border-box; font-size: 16px; font-weight: normal;">In the variadic case it could also be possible to use a trailing comma for disambiguation like so:</p><pre class="" style="margin: 0px 0px 16px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(247, 247, 247); color: inherit; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 16px; word-break: normal; word-wrap: normal; box-sizing: border-box; font-weight: normal; line-height: 1.45;"><code class="" style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; color: inherit; border: 0px; margin: 0px; padding: 0px; word-break: normal; word-wrap: normal; box-sizing: border-box; display: inline; overflow: visible; line-height: inherit;">someFunc([1],)  // Unambiguously a varaidic call of [[1]]
someFunc(foo,)  // Unambiguously a variadic call of [foo]
</code></pre><p class="" style="margin: 0px 0px 16px; box-sizing: border-box; font-size: 16px; font-weight: normal;">*These attributes could instead be compiler directives if that is more appropriate.</p><h2 class="" style="font-weight: bold; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); color: rgb(51, 51, 51); font-size: 24px; box-sizing: border-box; margin-top: 24px; margin-bottom: 16px; line-height: 1.25; padding-bottom: 0.3em; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255);"><a id="user-content-impact-on-existing-code" class="anchor" href="https://github.com/Haravikk/swift-evolution/blob/master/proposals/nnnn-variadics-as-attribute.md#impact-on-existing-code" aria-hidden="true" style="color: rgb(64, 120, 192); background-color: transparent; text-decoration: none; box-sizing: border-box; -webkit-text-decoration-skip: objects; float: left; padding-right: 4px; margin-left: -20px; line-height: 1;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Impact on existing code</h2><h1 class="" style="font-weight: bold; color: rgb(51, 51, 51); font-size: 28pt; box-sizing: border-box; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.25; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255); margin-top: 0px !important;"></h1><p class="" style="margin: 0px 0px 16px; box-sizing: border-box; font-size: 16px; font-weight: normal;">All existing variadic function function declarations will be invalidated, either being replaced or producing a fixit to perform conversion like so:</p><pre class="" style="margin: 0px 0px 16px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(247, 247, 247); color: inherit; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 16px; word-break: normal; word-wrap: normal; box-sizing: border-box; font-weight: normal; line-height: 1.45;"><code class="" style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; color: inherit; border: 0px; margin: 0px; padding: 0px; word-break: normal; word-wrap: normal; box-sizing: border-box; display: inline; overflow: visible; line-height: inherit;">func someFunc(_ values:Int...)          // Before
func someFunc(_ values:@variadic [Int]) // After
</code></pre><h2 class="" style="font-weight: bold; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); color: rgb(51, 51, 51); font-size: 24px; box-sizing: border-box; margin-top: 24px; margin-bottom: 16px; line-height: 1.25; padding-bottom: 0.3em; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255);"><a id="user-content-proposed-extension" class="anchor" href="https://github.com/Haravikk/swift-evolution/blob/master/proposals/nnnn-variadics-as-attribute.md#proposed-extension" aria-hidden="true" style="color: rgb(64, 120, 192); background-color: transparent; text-decoration: none; box-sizing: border-box; -webkit-text-decoration-skip: objects; float: left; padding-right: 4px; margin-left: -20px; line-height: 1;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Proposed Extension</h2><h1 class="" style="font-weight: bold; color: rgb(51, 51, 51); font-size: 28pt; box-sizing: border-box; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.25; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255); margin-top: 0px !important;"></h1><p class="" style="margin: 0px 0px 16px; box-sizing: border-box; font-size: 16px; font-weight: normal;">One other advantage of the use of an attribute is the possibility of allowing variadic enabled functions to accept a wider range of parameter types. For example, the above examples could be implemented instead like so:</p><pre class="" style="margin: 0px 0px 16px; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(247, 247, 247); color: inherit; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 16px; word-break: normal; word-wrap: normal; box-sizing: border-box; font-weight: normal; line-height: 1.45;"><code class="" style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; color: inherit; border: 0px; margin: 0px; padding: 0px; word-break: normal; word-wrap: normal; box-sizing: border-box; display: inline; overflow: visible; line-height: inherit;">func someFunc(_ values:@variadic MyArrayLiteralConvertible&lt;Int&gt;) { … } // Type conforming to ArrayLiteralConvertible
func someFunc&lt;I:IteratorProtocol where I.Element == Int&gt;(_ values:@variadic I) { … } // Implementation supports all single and multi-pass types
func someFunc&lt;S:Sequence where S.Iterator.Element == Int&gt;(_ values:@variadic S) { … } // Implementation supports all (probably) multi-pass types
func someFunc&lt;C:Collection where C.Iterator.Element == Int&gt;(_ values:@variadic C) { … } // Implementation supports all guaranteed multi-pass, indexable types with known size
</code></pre><p class="" style="margin: 0px 0px 16px; box-sizing: border-box; font-size: 16px; font-weight: normal;">When a specific type is defined it must conform to&nbsp;<code class="" style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgba(0, 0, 0, 0.0392157); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px; padding: 0.2em 0px; word-break: normal; word-wrap: normal; box-sizing: border-box;">ArrayLiteralConvertible</code>&nbsp;to enable variadic calls, while generic conformances must be capable of being satisfied by an&nbsp;<code class="" style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgba(0, 0, 0, 0.0392157); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px; padding: 0.2em 0px; word-break: normal; word-wrap: normal; box-sizing: border-box;">Array</code>&nbsp;when called in variadic style. For example, the latter three examples would all receive an&nbsp;<code class="" style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgba(0, 0, 0, 0.0392157); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px; padding: 0.2em 0px; word-break: normal; word-wrap: normal; box-sizing: border-box;">[Int]</code>&nbsp;when called in variadic style, but can accept any suitable iterator, sequence or collection when called dynamically. In other words, when a function is called in variadic style it is always passed an&nbsp;<code class="" style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgba(0, 0, 0, 0.0392157); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px; padding: 0.2em 0px; word-break: normal; word-wrap: normal; box-sizing: border-box;">Array</code>unless its type is&nbsp;<code class="" style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgba(0, 0, 0, 0.0392157); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px; padding: 0.2em 0px; word-break: normal; word-wrap: normal; box-sizing: border-box;">ArrayLiteralConvertible</code>, so its supported type(s) must support this.</p><p class="" style="margin: 0px 0px 16px; box-sizing: border-box; font-size: 16px; font-weight: normal;">This extension has been moved into its own section as it is not critical to the proposal, however it does represent an advantage of the attribute based approach, and would be desirable to have if implementing it is sufficiently easy for it to be done at the same time.</p><h2 class="" style="font-weight: bold; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); color: rgb(51, 51, 51); font-size: 24px; box-sizing: border-box; margin-top: 24px; margin-bottom: 16px; line-height: 1.25; padding-bottom: 0.3em; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255);"><a id="user-content-alternatives-considered" class="anchor" href="https://github.com/Haravikk/swift-evolution/blob/master/proposals/nnnn-variadics-as-attribute.md#alternatives-considered" aria-hidden="true" style="color: rgb(64, 120, 192); background-color: transparent; text-decoration: none; box-sizing: border-box; -webkit-text-decoration-skip: objects; float: left; padding-right: 4px; margin-left: -20px; line-height: 1;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Alternatives considered</h2><h1 class="" style="font-weight: bold; color: rgb(51, 51, 51); font-size: 28pt; box-sizing: border-box; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.25; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255); margin-top: 0px !important;"></h1><p class="" style="margin: 0px 0px 16px; box-sizing: border-box; font-size: 16px; font-weight: normal;">One alternative often mentioned is simply enabling the existing variadic declarations to be called with an array. However, this has the same issue with ambiguity to resolve, and leaves variadics as their own category of function, rather than unifying them with ordinary functions.</p><p class="" style="margin: 0px 0px 16px; box-sizing: border-box; font-size: 16px; font-weight: normal;">It is possible to both add the&nbsp;<code class="" style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgba(0, 0, 0, 0.0392157); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px; padding: 0.2em 0px; word-break: normal; word-wrap: normal; box-sizing: border-box;">@variadic</code>&nbsp;attribute and retain the current syntax as a shorthand, however if the proposed extension is implemented this would discourage consideration of the best collection type to use, and in general it would remove one advantage in removing this extraneous syntax.</p><div class="" style="box-sizing: border-box; margin-top: 0px; font-size: 16px; font-weight: normal; margin-bottom: 0px !important;">The nuclear option is to remove variadics entirely; this is the preference of some (myself included) as it eliminates the inherent ambiguity of variadics in general, forcing explicit use of arrays and other types with no need for limitations, however there is sufficient support for variadics now that they exist that this option is unlikely to succeed.</div></div></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></div></span></blockquote></div><div class="bloop_markdown" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);"></div></blockquote></div><br class=""></body></html>