<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 Feb 27, 2017, at 9:59 AM, Haravikk <<a href="mailto:swift-evolution@haravikk.me" class="">swift-evolution@haravikk.me</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 27 Feb 2017, at 17:10, Jose Cheyo Jimenez via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><div class=""><div dir="auto" class=""><div class="">On Feb 26, 2017, at 9:25 AM, Tino Heth via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div class="">I suggest to take a look at the topics "<span style="font-family: 'Helvetica Neue';" class="">Variadics as an Attribute" and "</span><font color="rgba(0, 0, 0, 0.85098)" face="Helvetica Neue" class="">array splatting for variadic parameters" and </font><a href="https://github.com/Haravikk/swift-evolution/blob/a13dc03d6a8c76b25a30710d70cbadc1eb31b3cd/proposals/nnnn-variadics-as-attribute.md" class="">https://github.com/Haravikk/swift-evolution/blob/a13dc03d6a8c76b25a30710d70cbadc1eb31b3cd/proposals/nnnn-variadics-as-attribute.md</a>.</div><div class=""><br class=""></div><div class="">This is basically the other way round (arrays would accept variadic arguments), but it has the same effect — and more:</div><div class="">You get rid of the odd "…" type, and it's also possible to use this with types besides array (set, iterator….)</div></div></blockquote><div class="">I agree with getting rid of the Type... because we could use ... in slicing (see String manifesto). Why must it be an attribute and not just "*" ? The advantage I see is that this will play great in also deconstructing collection like things like Array, Slice and Tuple. This is already familiar to python and ruby users. </div></div></div></blockquote></div><br class=""><div class="">Part of the aim is to avoid less easily discovered custom syntax; the point of the proposal is that there's no need for a special syntax just to support variadics as attributes already exist, plus they're more descriptive about what they do and easy to look-up.</div></div></div></blockquote></div><div class=""><br class=""></div><div class="">These is very unfortunate as a solution for “spreading” a collection or tuple so that It can be applied to function taking a variadic.</div><div class="">It makes sense on the declaration site but not on the call site. </div><div class=""><br class=""></div><div class="">someFunc(@nonVariadic [1]) </div><div class="">someFunc(@variadic [1]) </div><div class=""><br class=""></div><div class=""><div class="">There is nothing special about variadic/ spreading that would warrant an attribute. </div></div><div class=""><br class=""></div><div class=""><div class="">I think using attributes is not different than using a keyword like c# uses. </div><div class=""><a href="http://stackoverflow.com/questions/7580277/why-use-the-params-keyword" class="">http://stackoverflow.com/questions/7580277/why-use-the-params-keyword</a></div></div><div class=""><br class=""></div><div class="">Do we really want to tag every array/tuple with a @variadic or @nonVariadic tag when packing and unpacking parameters?</div><div class=""><br class=""></div><div class="">variadic/ spreading (AKA packing / unpacking ) is a well known concept to most languages. </div><div class=""><br class=""></div><div class="">someFunc(*[1]) <span class="Apple-tab-span" style="white-space:pre">        </span>// python, ruby,</div><div class=""><div class="">someFunc(...[1]) <span class="Apple-tab-span" style="white-space:pre">        </span> // php, ES6, golang</div></div><div class=""><br class=""></div><div class="">I am not proposing prefix * or prefix … as I think we should let the community decide but I would be opposed to using attributes or keywords. </div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></body></html>