<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 11:03 AM, <a href="mailto:swift@lng.la" class="">swift@lng.la</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=""><div class="">I'm +1 if this will eventually be replaced with a better-designed version, but I do use it and would be sad to see it go. I've found it very helpful for testing:</div></div></div></blockquote><div><br class=""></div><div>Hi Jarod, where are you using this feature?</div><br class=""><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=""><br class=""></div><div class=""><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><div style="margin: 0px; line-height: normal;" class=""><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">protocol</span> APIType {</div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><font color="#3b3b3b" class="">&nbsp; &nbsp;&nbsp;</font><span style="color: rgb(187, 44, 162);" class="">func</span><font color="#3b3b3b" class=""> getChatMessages(channel channel: </font><span style="color: rgb(112, 61, 170);" class="">ChatChannel</span><font color="#3b3b3b" class="">, limit: </font><span style="color: rgb(112, 61, 170);" class="">Int</span><font color="#3b3b3b" class="">, success: (chatMessages: [</font><span style="color: rgb(79, 129, 135);" class="">ChatMessage</span><font color="#3b3b3b" class="">]) -&gt; </font><span style="color: rgb(112, 61, 170);" class="">Void</span><font color="#3b3b3b" class="">, failure: (error:&nbsp;</font><span style="color: rgb(112, 61, 170);" class="">NSError</span><font color="#3b3b3b" class="">) -&gt; </font><span style="color: rgb(112, 61, 170);" class="">Void</span><font color="#3b3b3b" class="">)</font></div><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class="">}</div><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal; min-height: 13px;" class=""><br class=""></div><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">class</span> FakeAPI: <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">APIType</span> {</div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><font color="#3b3b3b" class="">&nbsp; &nbsp;&nbsp;</font><span style="color: rgb(187, 44, 162);" class="">var</span><font color="#3b3b3b" class=""> getChatMessagesEndpoint = </font><span style="color: rgb(79, 129, 135);" class="">FakeAPIEndpoint</span><font color="#3b3b3b" class="">(</font></div><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class="">&nbsp; &nbsp; &nbsp; &nbsp; calls:&nbsp; &nbsp; &nbsp; &nbsp; [(channel: ChatChannel, limit: <span style="color: rgb(112, 61, 170);" class="">Int</span>)](),</div><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class="">&nbsp; &nbsp; &nbsp; &nbsp; successStubs: [[<span style="color: rgb(79, 129, 135);" class="">ChatMessage</span>]](),</div><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class="">&nbsp; &nbsp; &nbsp; &nbsp; failureStubs: [<span style="color: rgb(112, 61, 170);" class="">NSError</span>]()</div><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class="">&nbsp; &nbsp; )</div><p style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal; min-height: 13px;" class="">&nbsp; &nbsp;&nbsp;<br class="webkit-block-placeholder"></p><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class="">&nbsp; &nbsp;&nbsp;<span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span> getChatMessages(channel channel: <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">ChatChannel</span>, limit: <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Int</span>, success: (chatMessages: [<span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">ChatMessage</span>]) -&gt; <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Void</span>, failure: (error:&nbsp;<span style="color: rgb(112, 61, 170);" class="">NSError</span>) -&gt; <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Void</span>) {</div><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class="">&nbsp; &nbsp; &nbsp; &nbsp; getChatMessagesEndpoint.handleCall(success, failure, callParams: (channel: channel, limit: limit))</div></div></div></div></div></div></blockquote><div><br class=""></div><div>If you are referring to this line, then there is no change. &nbsp;The only affected case is in call sites that take a single parameter without a label. &nbsp;Passing tuples as values will not be change.</div><div><br class=""></div><div>-Chris</div><div><br class=""></div><br class=""><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=""><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><div style="margin: 0px; line-height: normal;" class=""><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class="">&nbsp; &nbsp; }</div><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class="">}</div><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal; min-height: 13px;" class=""><br class=""></div><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">struct</span> FakeAPIEndpoint&lt;CallParams, SuccessParams, FailureParams&gt; {</div><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class="">&nbsp; &nbsp;&nbsp;<span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">private(set)</span> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">var</span> calls:&nbsp; &nbsp; &nbsp; &nbsp; [<span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">CallParams</span>]</div><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class="">&nbsp; &nbsp;&nbsp;<span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">private(set)</span> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">var</span> successStubs: [<span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">SuccessParams</span>]</div><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class="">&nbsp; &nbsp;&nbsp;<span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">private(set)</span> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">var</span> failureStubs: [<span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">FailureParams</span>]</div><p style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal; min-height: 13px;" class="">&nbsp; &nbsp;&nbsp;<br class="webkit-block-placeholder"></p><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class="">&nbsp; &nbsp;&nbsp;<span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">mutating</span> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span> stubSuccess(params: <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">SuccessParams</span>) {</div><div style="color: rgb(79, 129, 135); margin: 0px; font-size: 11px; line-height: normal;" class=""><span style="color: rgb(59, 59, 59);" class="">&nbsp; &nbsp;&nbsp;</span><span style="color: rgb(59, 59, 59);" class="">&nbsp; &nbsp;&nbsp;</span>successStubs<span style="" class="">.</span><span style="color: rgb(61, 29, 129);" class="">append</span><span style="" class="">(params)</span></div><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class="">&nbsp; &nbsp; }</div><p style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal; min-height: 13px;" class="">&nbsp; &nbsp;&nbsp;<br class="webkit-block-placeholder"></p><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class="">&nbsp; &nbsp;&nbsp;<span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">mutating</span> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span> stubFailure(params: <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">FailureParams</span>) {</div><div style="color: rgb(79, 129, 135); margin: 0px; font-size: 11px; line-height: normal;" class=""><span style="color: rgb(59, 59, 59);" class="">&nbsp; &nbsp;&nbsp;</span><span style="color: rgb(59, 59, 59);" class="">&nbsp; &nbsp;&nbsp;</span>failureStubs<span style="" class="">.</span><span style="color: rgb(61, 29, 129);" class="">append</span><span style="" class="">(params)</span></div><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class="">&nbsp; &nbsp; }</div><p style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal; min-height: 13px;" class="">&nbsp; &nbsp;&nbsp;<br class="webkit-block-placeholder"></p><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class="">&nbsp; &nbsp;&nbsp;<span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">private</span> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">mutating</span> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span> handleCall(success: (<span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">SuccessParams</span>) -&gt; <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Void</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">_</span> failure: (<span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">FailureParams</span>) -&gt; <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Void</span>, call: <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">CallParams</span>) {</div><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span style="color: rgb(79, 129, 135);" class="">calls</span>.<span style="color: rgb(61, 29, 129);" class="">append</span>(call)</div><p style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal; min-height: 13px;" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br class="webkit-block-placeholder"></p><div style="color: rgb(79, 129, 135); margin: 0px; font-size: 11px; line-height: normal;" class=""><span style="color: rgb(59, 59, 59);" class="">&nbsp; &nbsp;&nbsp;</span><span style="color: rgb(59, 59, 59);" class="">&nbsp; &nbsp;&nbsp;</span><span style="color: rgb(187, 44, 162);" class="">if</span><span style="" class=""> </span>successStubs<span style="" class="">.</span><span style="color: rgb(112, 61, 170);" class="">count</span><span style="" class=""> &gt; </span><span style="color: rgb(39, 42, 216);" class="">0</span><span style="" class=""> {</span></div><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; success(<span style="color: rgb(79, 129, 135);" class="">successStubs</span>.<span style="color: rgb(61, 29, 129);" class="">removeFirst</span>())</div><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class="">&nbsp; &nbsp; &nbsp; &nbsp; }</div><div style="color: rgb(79, 129, 135); margin: 0px; font-size: 11px; line-height: normal;" class=""><span style="color: rgb(59, 59, 59);" class="">&nbsp; &nbsp;&nbsp;</span><span style="color: rgb(59, 59, 59);" class="">&nbsp; &nbsp;&nbsp;</span><span style="color: rgb(187, 44, 162);" class="">else</span><span style="" class=""> </span><span style="color: rgb(187, 44, 162);" class="">if</span><span style="" class=""> </span>failureStubs<span style="" class="">.</span><span style="color: rgb(112, 61, 170);" class="">count</span><span style="" class=""> &gt; </span><span style="color: rgb(39, 42, 216);" class="">0</span><span style="" class=""> {</span></div><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; failure(<span style="color: rgb(79, 129, 135);" class="">failureStubs</span>.<span style="color: rgb(61, 29, 129);" class="">removeFirst</span>())</div><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class="">&nbsp; &nbsp; &nbsp; &nbsp; }</div><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class="">&nbsp; &nbsp; }</div><div style="color: rgb(59, 59, 59); margin: 0px; font-size: 11px; line-height: normal;" class="">}</div></div></div></div><div class=""><br class=""></div><div class="">It's really nice to have that handleCall method that can call the success or failure callback automatically rather than reimplementing that functionality in every fake API call.</div><div class=""><br class=""></div><div class="">Jarod</div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jan 27, 2016, at 10:16, Chris Lattner via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><div class=""><div class=""><br class=""><blockquote type="cite" class="">On Jan 27, 2016, at 2:18 AM, Nisse Bergman &lt;<a href="mailto:nisse@potmo.com" class="">nisse@potmo.com</a>&gt; wrote:<br class=""><br class="">-1 I use this in both my mocking API and in JSON deserialising/serializing.<br class="">I think this is a great thing to have.<br class=""></blockquote><br class="">Ok, I’m definitely interested in knowing more. &nbsp;Please include a code sample, showing both the declaration being splatted into and the call sites. &nbsp;Otherwise, I can’t tell how much value this feature is adding, and what the pain would be if it were removed. &nbsp;Thanks!<br class=""><br class="">-Chris<br class=""><br class=""><blockquote type="cite" class=""><br class=""><blockquote type="cite" class="">On 27 Jan 2016, at 11:07, David Waite via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><br class="">I used this just last week! But only as an illustration<br class=""><br class="">+1<br class=""><br class="">One comment though, a splat operator need not be purely syntactic sugar - it could be the way arrays are applied to variadic functions.<br class=""><br class="">-DW<br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></blockquote><br class=""></blockquote><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></body></html>