<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 Dec 11, 2015, at 10:54 PM, Kevin Ballard via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<title class=""></title>
<div class=""><div class="">You can't use * as suggested, because that conflicts with * as a prefix operator.<br class=""></div>
<div class=""> </div>
<div class="">You could probably get away with using a trailing ... in the call, as in<br class=""></div>
<div class=""> </div>
<div class="">func foo(xs: [Int]...) {<br class=""></div>
<div class=""> bar(xs...)<br class=""></div>
<div class="">}<br class=""></div>
<div class=""> </div>
<div class="">I also wonder whether there's a reason Swift doesn't already support this. Maybe there's some desired future change to variadic arguments to improve performance (i.e. to avoid having to allocate an array) that wouldn't be compatible? Although I'm not sure what that would be. Maybe there's actually no barrier at all and it was just something that wasn't prioritized. It would be good to know either way.</div></div></div></blockquote><div><br class=""></div><div>No fundamental reason, just haven't gotten around to it. We are however planning to rework the type system model for functions not to be tuple-based, since it causes problems with unconstrained polymorphism, default arguments, inout parameters, and other function features. We'll need a replacement feature to support forwarding argument tuples if we do this. cc'ing Chris Willmore, who has been working a plan here.</div><div><br class=""></div><div>-Joe</div><br class=""><blockquote type="cite" class=""><div class=""><div class="">
<div class="">-Kevin<br class=""></div>
<div class=""> </div>
<div class="">On Fri, Dec 11, 2015, at 10:43 PM, Arthur Sabintsev via swift-evolution wrote:<br class=""></div>
<blockquote type="cite" class=""><div style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class="">Hi,<br class=""></div>
<div style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class=""> </div>
<div style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class="">I have put together a proposal for passing arrays to variadic functions (along the lines of Ruby’s Splay operator). <br class=""></div>
<div style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class=""> </div>
<div style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class="">Proposal: <a href="https://github.com/ArtSabintsev/swift-evolution/blob/master/proposals/array-variadic-function.md" class="">https://github.com/ArtSabintsev/swift-evolution/blob/master/proposals/array-variadic-function.md</a><br class=""></div>
<div style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class="">Pull Request: <a href="https://github.com/apple/swift-evolution/pull/52" class="">https://github.com/apple/swift-evolution/pull/52</a><br class=""></div>
<div style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class="">Bug Report: <a href="https://bugs.swift.org/browse/SR-128" class="">https://bugs.swift.org/browse/SR-128</a> which led to this proposal<br class=""></div>
<div style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class=""> </div>
<div class=""> </div>
<div class=""><div style="font-family:helvetica, arial;font-size:13px;" class=""><div style="color:rgb(34, 34, 34);font-family:arial, sans-serif;" class="">Best,<br class=""></div>
<div style="color:rgb(34, 34, 34);font-family:arial, sans-serif;" class=""> </div>
<div class=""><span class="colour" style="color:rgb(34, 34, 34)"><span class="font" style="font-family:arial, sans-serif">Arthur / <a href="http://sabintsev.com/" class="">Sabintsev.com</a></span></span><br class=""></div>
</div>
</div>
<div class=""><img style="height:1px !important;width:1px !important;border-top-width:0px !important;border-right-width:0px !important;border-bottom-width:0px !important;border-left-width:0px !important;margin-top:0px !important;margin-bottom:0px !important;margin-right:0px !important;margin-left:0px !important;padding-top:0px !important;padding-bottom:0px !important;padding-right:0px !important;padding-left:0px !important;" border="0" height="1" width="1" alt="" src="https://www.fastmailusercontent.com/proxy/711f3e7b99078126bfee5afb315066b72e56b15a5729069b616122bbf989cc39/8647470737a3f2f25723030323431303e23647e23756e64676279646e2e65647f27766f2f60756e6f35707e6d3148765176786c673171614a7d2236454230345272776e4459394d22324158633668743373365a4d22364075573265543b6376796f48333566326679787673433d444435703d2232436837577577576254335d22324740393a774d4f69343d223643583474757f61753f64513e46324d453b657c41566d22364847734f42327c6949523170575858497a5d6648673836745472534a616876667a50746c6b4465603b6d223645524a6c4a607d6447566861746970595c463253396d22364f6242383f467477375176583961703d43576948397869695745687e674443347637424731417439586d2232476d23344d23344/open" class=""><br class=""></div>
<div class=""><u class="">_______________________________________________</u><br class=""></div>
<div class="">swift-evolution mailing list<br class=""></div>
<div class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""></div>
<div class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div>
</blockquote><div class=""> </div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=RoDF4MveSEMYBIqIJA6ub1g8cOZ-2BVYvqV-2FqygPhjPn960ES0qL7GZJGtPQQOU30yreTn0OcDnpFVImJ-2FklacuBqGasv4Vq8o-2B-2BEEKQaH3oQz04lbJmulYhwT6cKqMjFt-2BcNHf-2Fy6ku6I9SrhuWKwBRZmj2N6t8DsDu7ZZSYVHfc2r6ZKMSmOeClH0ss9IGg8GO81dA9r5U-2BHiVThCz9b0bmcKYbuMeGHsNKU9jnTsXE-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;" class="">
</div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>