<div dir="ltr">I'm a -1 because of the syntax, I think it's nice and concise, and unambiguous, but while it's familiar to people used to ObjectiveC it's closer to ObjectiveC syntax than it is Swift.<div><br></div><div>I would +1 this proposal if the syntax was like this:<br><font face="monospace, monospace" style="font-size:13px"> let fn1 = someView.insertSubview(_,aboveSubview:)<br> let fn = someView.insertSubview(_,at:_) // optional _ if it's needed to disambiguate</font><div><br></div><div>That syntax would allow it to be naturally extended to support partial application (Like what<font face="arial, helvetica, sans-serif"> <span class="" style="color:rgb(51,51,51)">Bartlomiej</span><span style="color:rgb(51,51,51)"> Cichosz </span><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151228/004739.html" target="_blank" style="color:rgb(64,120,192);background-color:transparent;text-decoration:none">suggests</a>)</font>:</div></div><div><div><div><span style="font-family:monospace,monospace;font-size:13px"> let t1 = someView.insertSubview(_ </span><span style="font-family:monospace,monospace;font-size:13px;background-color:rgb(217,234,211)">,</span><span style="font-family:monospace,monospace;font-size:13px"> </span><span style="font-family:monospace,monospace;font-size:13px">aboveSubview: ) // equivalent of yours</span><br></div></div></div><div><span style="font-family:monospace,monospace;font-size:13px"> let t2 = someView.insertSubview(_ </span><span style="font-family:monospace,monospace;font-size:13px;background-color:rgb(217,234,211)">,</span><span style="font-family:monospace,monospace;font-size:13px"> </span><span style="font-family:monospace,monospace;font-size:13px">aboveSubview:v1) </span><font face="monospace, monospace"><span style="font-size:13px">// <font color="#333333">partial application</font></span></font><span style="font-family:monospace,monospace;font-size:13px"><br></span></div><div><span style="font-family:monospace,monospace;font-size:13px"> let t3 = someView.insertSubview(v0</span><span style="font-family:monospace,monospace;font-size:13px;background-color:rgb(217,234,211)">,</span><span style="font-family:monospace,monospace;font-size:13px"> </span><span style="font-family:monospace,monospace;font-size:13px">aboveSubview:</span><span style="font-family:monospace,monospace;font-size:13px">v1</span><span style="font-family:monospace,monospace;font-size:13px">) // calling a function</span></div><div><br></div><div><div><div><div style="font-size:13px">This syntax is not quite as concise, but is much less surprising and more logical than yours:</div></div></div></div><span style="font-size:13px;font-family:monospace,monospace"> let u1 = someView.insertSubview( _<b style="background-color:rgb(234,153,153)">:</b> </span><span style="font-size:13px;font-family:monospace,monospace">aboveSubview: ) // yours</span><br><span style="font-size:13px;font-family:monospace,monospace"> let u2 = someView.insertSubview( _<span style="background-color:rgb(217,234,211)">,</span> </span><span style="font-size:13px;font-family:monospace,monospace">aboveSubview: v1) //</span><font face="monospace, monospace"><span style="font-size:13px"> </span></font><span style="color:rgb(51,51,51);font-family:monospace,monospace;font-size:13px">partial application</span><br><div style="font-size:13px"><div><span style="font-family:monospace,monospace"> let u3 = someView.insertSubview(v0</span><span style="font-family:monospace,monospace;background-color:rgb(217,234,211)">,</span><span style="font-family:monospace,monospace"> </span><span style="font-family:monospace,monospace">aboveSubview: </span><span style="font-family:monospace,monospace">v1</span><span style="font-family:monospace,monospace">)</span><span style="font-family:monospace,monospace"> </span><span style="font-family:monospace,monospace">// calling a function</span></div></div><div style="font-size:13px"><div><div><div></div></div><div><div></div></div></div></div><div style="font-size:13px"><br></div><div style="font-size:13px">The first <b><font face="monospace, monospace">:</font></b> in u1 is jarring and differs greatly from the expected syntax. Whether the partial application syntax is adopted or not; the delimiters are different to what you use when declaring or calling a function, the exception doesn't seem necessary.</div><div style="font-size:13px"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 14, 2016 at 10:05 AM, Douglas Gregor via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</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 Jan 13, 2016, at 12:08 PM, Jérôme Duquennoy via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:</div><br><div><div style="word-wrap:break-word"><blockquote type="cite" style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-family:TimesNewRomanPSMT"><div style="word-wrap:break-word"><span style="white-space:pre-wrap">        </span>* What is your evaluation of the proposal?</div></blockquote><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">This proposal does solve a real problem.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">I have one concern about that proposal though: this is solving a compiler ambiguity, but I think it would introduce a "visual" ambiguity :</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="white-space:pre-wrap">        </span>let variable = function(arg1, argName: arg2) // function call</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="white-space:pre-wrap">        </span>let variable = function (_:, argName:) // assign function to a variable</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Those who lines, despite being pretty close visually, are very different.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">I have the feeling that it might make non-obvious pieces a bit harder to read. That could reduce swift readability.</div></div></div></blockquote><div><br></div></span><div>FWIW, there are no commas in the compound names of this proposal. That last line should be:</div><div><br></div><div><span style="white-space:pre-wrap">        </span>let variable = function(_:argName:) // assign function to a variable</div><div><br></div><div>In the case where there is a first argument label, it is visually close:</div><div><br></div><div><span style="white-space:pre-wrap">        </span>let variable = function(foo:bar:)</div><div><br></div><div>one has to scan to the last ‘:’ to distinguish it from a call.</div><div><br></div><div><span style="white-space:pre-wrap">        </span>- Doug</div><div><br></div><blockquote type="cite"><div><div style="word-wrap:break-word"><div><div class="h5"><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Todays method (using a closure) is more verbose, but it is less ambiguous visually I think.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">I would be happy to have this possibility, but not at the cost of code readability.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><blockquote type="cite" style="font-family:TimesNewRomanPSMT"><div style="word-wrap:break-word">* Is the problem being addressed significant enough to warrant a change to Swift?</div></blockquote><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">As a developper, I didn't encounter that situation a lot : I assign closures to variables much more than functions.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Nevertheless, the current situation sounds a bit like an incoherency between the way swift identifies methods internally and the way the developper can refer to methods. I am absolutely no expert in compilers, but can that be a flaw that would become problematic later on ? Sorry, I cannot say :-). But if it is, then the problem surely is significant enough to be addressed.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><blockquote type="cite" style="font-family:TimesNewRomanPSMT"><div style="word-wrap:break-word">* Does this proposal fit well with the feel and direction of Swift?</div></blockquote><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">As explained before, I feel the syntax proposed in that evolution has a cost on readability, as it makes two very different things very similar visually.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><blockquote type="cite" style="font-family:TimesNewRomanPSMT"><div style="word-wrap:break-word">* How much effort did you put into your review? A glance, a quick reading, or an in-depth study?</div></blockquote><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:TimesNewRomanPSMT">I’ve read the discussion on swift-evolution and the final proposal on GitHub.</span></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">I have to say that I didn't even found a syntax that I could propose to avoid the visual ambiguity.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Jerome</div><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><blockquote type="cite"><div>Le 13 janv. 2016 à 18:16, Joe Groff via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> a écrit :</div><br><div><div style="word-wrap:break-word">Hello Swift community,<br><br>The review of "Naming Functions with Argument Labels" begins now and runs through January 10th. The proposal is available here:<br><br><span style="white-space:pre-wrap">        </span><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0018-flexible-memberwise-initialization.md" target="_blank">https://github.com/apple/swift-evolution/blob/master/proposals/0021-generalized-naming.md</a><br><br>Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at<br><br><span style="white-space:pre-wrap">        </span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br><br>or, if you would like to keep your feedback private, directly to the review manager.<br><br>What goes into a review?<br><br>The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of Swift. When writing your review, here are some questions you might want to answer in your review:<br><br><span style="white-space:pre-wrap">        </span>* What is your evaluation of the proposal?<br><span style="white-space:pre-wrap">        </span>* Is the problem being addressed significant enough to warrant a change to Swift?<br><span style="white-space:pre-wrap">        </span>* Does this proposal fit well with the feel and direction of Swift?<br><span style="white-space:pre-wrap">        </span>* If you have you used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?<br><span style="white-space:pre-wrap">        </span>* How much effort did you put into your review? A glance, a quick reading, or an in-depth study?<br><br>More information about the Swift evolution process is available at<br><br><span style="white-space:pre-wrap">        </span><a href="https://github.com/apple/swift-evolution/blob/master/process.md" target="_blank">https://github.com/apple/swift-evolution/blob/master/process.md</a><br><br>Thank you,<br><br>-Joe<br>Review Manager<br><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=ZfNDJ3c1KY40DpRPxaBpmw0PAd1TZW0h3lqFWlwcZNUCofbdEvLB6zu4OD0kz0YDWRV8w4Zb5TjM4xmaUh4-2FfOhu-2BShwOh2T7MFCVlC1QAREdrtMh1gpkSPw4CYKsQQR6dlQB48-2FDR2weflZ7zu2Iq7a4eBrG5Y20CRYPTcz776U3md6XgDAon1By-2B8OVxQt8Qfkpc2WvDr5sDszaHKGbvZdbXrv8LB4d2s5RV0VoCQ-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0px!important;margin:0px!important;padding:0px!important"></div>_______________________________________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div></blockquote></div><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"></div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=XbU4wxnU83GyR7TGhOdBtBOchMF7PYvaYPXWDKda2fcuHwUx7ehUm5oUa88n0mhTNXvKM770UXTUEm3Ia8ahGVsA3oydnv4aM9cqgDrUl7JiAE3XiOjLKcmqlXqE7zZBDDYkNX42obK8uoo-2FzV8tbmWy3rLA0-2FnD8RNKhJ-2B3Nbde550o5rFqD-2Fm17-2B9972PngNHX8z2TteHQ3-2FUbuGKmCLuLFesMcobjedUGRTg6SoU-3D" alt="" width="1" height="1" border="0" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;min-height:1px!important;width:1px!important;border-width:0px!important;margin:0px!important;padding:0px!important"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important"><span> </span>_______________________________________________</span><span class=""><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">swift-evolution mailing list</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="mailto:swift-evolution@swift.org" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">swift-evolution@swift.org</a><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span></div></div></blockquote></div><br>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=pQw7h83fWt3LLbgkfL4TSUL0weaZnVFZxDe5GShw4uT0M8pimjmrIr1bCl77CVORJD0lo7vam6FrMWrEtvXZH2GkHJ-2BAKA20vpM2P74lQtFnc6rW8pcMnRcb9ctmIcoCCMCxGUQGiryPspv6HRO6Uf5lfUZ1ZLScpvb-2FmBjsbxo6hICKP6uqthnlGBzz7G2rs0F9t2PY8msVH2EJ2Ya5-2FxmvxLShOi6P7KuN1A6zeR0-3D" alt="" width="1" height="1" border="0" style="min-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">
</div>
<br>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br></blockquote></div><br></div>