<div dir="ltr">Thank you very much for your response Joe.<div><br></div><div>That pretty much clarifies everything I wanted, and I think your points are good for your proposal to be consistent. However I agree with Brent, this is a feature that I use often and I am unsure whether you're underestimating its use.</div><div><br></div><div>I think I would be happy with your proposal if:</div><div><ul><li>Brackets around generic parens lists differentiates single and multiple parameters (as you discussed with me).</li><li>A temporary function was introduced to provide backwards compatibility (in a generic setting), until a more thoroughly thought-out proposal is made.</li></ul><div>Otherwise, I think that this is a great proposal, but I'm afraid my evaluation is as follows:</div></div><div><br></div><div><span style="color:rgb(80,0,80);font-size:13px"> • What is your evaluation of the proposal?</span><br></div>-1<div><br>It's a necessary change, it removes ambiguity and a gotcha that exercises functionality most users won't directly take advantage of. However, it does not sufficiently cover the timeline or handling of lost functionality. I feel like it breaks an entire class of existing clear, concise, and robust functions. It also hinders and practical exploration of generic function utilities in Swift.<div><br></div><div><span style="color:rgb(80,0,80);font-size:13px"> </span><span style="color:rgb(80,0,80);font-size:13px"> •</span><span style="color:rgb(80,0,80);font-size:13px"> </span><span style="color:rgb(80,0,80);font-size:13px">Is the problem being addressed significant enough to warrant a change to Swift?</span></div><div>Yes</div><div><br></div><div><span style="color:rgb(80,0,80);font-size:13px"> • Does this proposal fit well with the feel and direction of Swift?</span><br></div><div>Yes and no, I think it fits well in that it reduces surprises and removes ambiguity. However I think that it will put a stop to many Swift libraries, current and future, that use splat to provide function utilities. I feel like this should be a yes, but perhaps the proposal is incomplete in this regard.<span style="color:rgb(80,0,80);font-size:13px"><br></span></div><div><br></div><div><span style="color:rgb(80,0,80);font-size:13px"> • If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?</span><br></div>As with Brent, I've used other languages with the functionality being removed and I've found it extremely useful. The lost functionality can reduce a lot of boilerplate, in many cases making code much more clear, concise, and robust. The lost functionality allows the complexity of generalised functions to abstracted, a user need not know how it works, but can benefit from the added clarity and utility.<div><span style="color:rgb(80,0,80);font-size:13px"><br></span></div><div><span style="color:rgb(80,0,80);font-size:13px"> • How much effort did you put into your review? A glance, a quick reading, or an in-depth study?</span><br></div><div><span style="color:rgb(80,0,80);font-size:13px">An in-depth study.</span></div><div><span style="color:rgb(80,0,80);font-size:13px"><br></span></div>I've explored what could and could not work after this proposal, in code. I'm using the functionality this proposal removes in production code. I've experimented with a non-generic solution to splatting, and the limitations it creates (in a generic context). I've also extrapolated from how the removed functionality could be expanded with well designed and thought out language support, and created a proposal (I hope) to pave the way for that.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 9, 2016 at 3:01 AM, Joe Groff <span dir="ltr"><<a href="mailto:jgroff@apple.com" target="_blank">jgroff@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><span class=""><blockquote type="cite"><div>On Feb 5, 2016, at 3:54 PM, Andrew Bennett <<a href="mailto:cacoyi@gmail.com" target="_blank">cacoyi@gmail.com</a>> wrote:</div><br><div><div dir="ltr">Hi Joe,<div><br></div><div>I'm sorry to bring up the "common point of confusion", but I'd like a little more clarification to help me review :). Your example of valid syntax is this:</div><div><br></div><div><pre style="overflow:auto;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;margin-top:0px;margin-bottom:0px;line-height:1.45;padding:16px;background-color:rgb(247,247,247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-wrap:normal;color:rgb(51,51,51)"><span style="color:rgb(167,29,93)">func</span> <span style="color:rgb(121,93,163)">f2</span><T>(a <span style="color:rgb(167,29,93)">:</span> T) <span style="color:rgb(167,29,93)">-></span> T { <span style="color:rgb(167,29,93)">...</span> }
<span style="color:rgb(167,29,93)">let</span> x <span style="color:rgb(167,29,93)">=</span> (<span style="color:rgb(0,134,179)">1</span>, <span style="color:rgb(0,134,179)">2</span>)
f2(x)</pre></div><div><br></div><div>It gets a little more complicated when generic closures are involved. I am wondering which aspects of this (if any) will still valid:</div><div><br></div><div><pre style="overflow:auto;margin-top:0px;margin-bottom:0px;line-height:1.45;padding:16px;background-color:rgb(247,247,247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-wrap:normal;color:rgb(51,51,51)"><div style="font-family:Menlo;font-size:11px;margin:0px;line-height:normal"><span style="color:rgb(187,44,162)">func</span> call<T,U>(value: <span style="color:rgb(112,61,170)">T</span>, apply: <span style="color:rgb(112,61,170)">T</span>-><span style="color:rgb(112,61,170)">U</span>) -> <span style="color:rgb(112,61,170)">U</span> {</div><div style="margin:0px;line-height:normal"><font face="Consolas, Liberation Mono, Menlo, Courier, monospace"><span style="font-size:14px"> </span></font><span style="font-family:Menlo;font-size:11px"> <span style="color:rgb(187,44,162)">return</span> apply(value)</span></div><div style="font-family:Menlo;font-size:11px;margin:0px;line-height:normal">}</div><div style="font-family:Menlo;font-size:11px;margin:0px;line-height:normal"><span style="color:rgb(187,44,162)">func</span> call2<T,U>(apply: <span style="color:rgb(112,61,170)">T</span>-><span style="color:rgb(112,61,170)">U</span>) -> (<span style="color:rgb(112,61,170)">T</span> -> <span style="color:rgb(112,61,170)">U</span>) {</div><div style="font-family:Menlo;font-size:11px;margin:0px;line-height:normal"> <span style="color:rgb(187,44,162)">return</span> { apply($0) }</div><div style="font-family:Menlo;font-size:11px;margin:0px;line-height:normal">}</div><div style="font-family:Menlo;font-size:11px;margin:0px;line-height:normal"><span style="color:rgb(187,44,162)">func</span> test(a: <span style="color:rgb(112,61,170)">Int</span>, b: <span style="color:rgb(112,61,170)">Int</span>, c: <span style="color:rgb(112,61,170)">Int</span>) -> (<span style="color:rgb(112,61,170)">Int</span>, <span style="color:rgb(112,61,170)">Int</span>) {</div><div style="font-family:Menlo;font-size:11px;margin:0px;line-height:normal"> <span style="color:rgb(187,44,162)">return</span> (a + b, b + c)</div><div style="font-family:Menlo;font-size:11px;margin:0px;line-height:normal">}</div><font face="Consolas, Liberation Mono, Menlo, Courier, monospace"><span style="font-size:14px">
</span></font><div style="font-family:Menlo;font-size:11px;margin:0px;line-height:normal"><span style="color:rgb(187,44,162)">let</span> a = <span style="color:rgb(49,89,93)">call</span>((<span style="color:rgb(39,42,216)">1</span>, <span style="color:rgb(39,42,216)">2</span>, <span style="color:rgb(39,42,216)">3</span>), apply: <span style="color:rgb(49,89,93)">test</span>)</div><div style="font-family:Menlo;font-size:11px;margin:0px;line-height:normal"><span style="color:rgb(187,44,162)">let</span> b = <span style="color:rgb(49,89,93)">call2</span>(<span style="color:rgb(49,89,93)">test</span>)(<span style="color:rgb(39,42,216)">1</span>, <span style="color:rgb(39,42,216)">2</span>, <span style="color:rgb(39,42,216)">3</span>)</div></pre></div><div><br></div><div>By my interpretation <span style="color:rgb(51,51,51);font-family:Menlo;font-size:11px;white-space:pre-wrap;background-color:rgb(247,247,247)">apply</span> uses "pass an entire argument list as a single value", so it would be invalid. However I don't think it has the same syntactic ambiguity that you talked about in your proposal.</div><div><br></div><div><b>If it is invalid:</b></div><div><ul><li>Should the compiler only allow (<span style="font-family:Menlo;font-size:11px;white-space:pre-wrap;color:rgb(112,61,170)">T</span><span style="color:rgb(51,51,51);font-family:Menlo;font-size:11px;white-space:pre-wrap;background-color:rgb(247,247,247)">-></span><span style="font-family:Menlo;font-size:11px;white-space:pre-wrap;color:rgb(112,61,170)">U</span>) to be a function from a single value?</li></ul></div></div></div></blockquote></span><div>Yeah, AIUI.</div><span class=""><blockquote type="cite"><div><div dir="ltr"><div><ul><li>Should a change to closure type signatures be more explicit in the proposal?</li></ul></div></div></div></blockquote></span><div>I think so. It'd probably be a good idea to at least change the syntax to require parens around the argument list, (T) -> U, to make this more apparent.</div><span class=""><blockquote type="cite"><div><div dir="ltr"><div><ul><li>You mention a <span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;background-color:rgb(247,247,247)">foo(</span><span style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;background-color:rgb(247,247,247);color:rgb(167,29,93)">*</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;background-color:rgb(247,247,247)">x)</span> style solution, this would probably also require <span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;background-color:rgb(247,247,247)">T*</span> equivalent. Is this something that you view as inevitable, do you think it will be considered within the Swift4 timeframe?</li></ul></div></div></div></blockquote></span><div>We're definitely interested in designing a proper solution to this, so that useful generic utilities can still be written. When it lands depends on when we have bandwidth to design and implement it.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-Joe</div></font></span></div></div></blockquote></div><br></div>