<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 Jan 27, 2016, at 9:27 AM, Dave 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=""><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="">Fair enough. Can we get an explicit, well-designed version of this before we get rid of the implicit, poorly-designed version?</div></div></blockquote><div><br class=""></div><div>I’m certainly not opposed to someone exploring this, but I don’t think it should block removing the bad thing.</div><div><br class=""></div><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">I can’t recall off the top my head where, but I <i class="">know</i> I’ve done something like this:</div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">struct</span> FunctionApplicator <T, U> {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">var</span> args: <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">T</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span> function: <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">T</span> -> <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">U</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">init</span>(args: <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">T</span>, function: <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">T</span> -> <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">U</span>) {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">self</span>.<span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">args</span> = args</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">self</span>.<span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">function</span> = function</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> }</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span> apply() -> <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">U</span> {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class=""><span style="" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">return</span><span style="" class=""> </span>function<span style="" class="">(</span>args<span style="" class="">)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> }</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">}</div></div><div class=""><br class=""></div><div class="">Without tuple splatting, you’d need a <span style="font-family: Menlo; font-size: 11px;" class="">FunctionApplicator1<T,U></span>, <span style="font-family: Menlo; font-size: 11px;" class="">FunctionApplicator2<T,U,V></span>, <span style="font-family: Menlo; font-size: 11px;" class="">FunctionApplicator3<T,U,V,W></span>, etc. They can’t even have the same name because Swift doesn’t support overloading type names for types with a different number of generic parameters.</div></div></div></blockquote><div><br class=""></div><div>Perhaps I’m misunderstanding, but that is certainly not the case. Even without the feature in question you can definitely pass a tuple around as a single argument, e.g.:</div><div><br class=""></div><div>func f(a : Int, _ b : Int) {…}</div><div><br class=""></div><div>let x = FunctionApplicator((42, b: 19), f)</div><div><br class=""></div><div>This functionality won’t be affected by removal of this feature.</div><div><br class=""></div><div>-Chris</div></div></body></html>