<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 Feb 2, 2016, at 3:03 PM, Erica Sadun via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; 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="">In current Swift, &nbsp;this approach does not preserve argument labels :</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 18px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span> partial1 = { <span style="font-variant-ligatures: no-common-ligatures; color: #31595d" class="">projectFunctionToCoordinateSystem</span>(function: mySinFunction, p0: p0, p1: p1, x: $0) } <span style="font-variant-ligatures: no-common-ligatures; color: #008400" class="">// (CGFloat) -&gt; CGPoint</span></div><div style="margin: 0px; font-size: 18px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span> partial2 = { <span style="font-variant-ligatures: no-common-ligatures; color: #31595d" class="">projectFunctionToCoordinateSystem</span>(function: mySinFunction, p0: .zero, p1: $0, x: $1) } <span style="font-variant-ligatures: no-common-ligatures; color: #008400" class="">// (CGPoint, CGFloat) -&gt; CGPoint</span></div></div><div class=""><span style="font-variant-ligatures: no-common-ligatures; color: #008400" class=""><br class=""></span></div><div class=""><br class=""></div><div class="">must be called <font face="Menlo" class="">partial1(0.5)</font>, not <font face="Menlo" class="">partial1(x: 0.5)</font>, unless you go to some significant work, as in the following:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 18px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span> partial1: (x: <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">CGFloat</span>) -&gt; <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">CGPoint</span> = {</div><div style="margin: 0px; font-size: 18px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp;&nbsp;<span style="color: rgb(49, 89, 93);" class="">projectFunctionToCoordinateSystem</span>(function: <span style="color: rgb(49, 89, 93);" class="">mySinFunction</span>, p0: <span style="color: rgb(79, 129, 135);" class="">p0</span>, p1: <span style="color: rgb(79, 129, 135);" class="">p1</span>, x: $0)&nbsp;</div><div style="margin: 0px; font-size: 18px; line-height: normal; font-family: Menlo;" class="">}</div></div><div class=""><br class=""></div><div class="">It's not that this is undoable, it's just ugly and laborious, things that are un-Swifty. &nbsp;You must decide a priori which arguments will be applied, and manually name those that will not.</div><div class=""><br class=""></div><div class="">Compare with, for example, an imaginary version that uses $$ to accomplish the same with less planning and greater win:</div><div class=""><br class=""></div><div class=""><span style="font-family: Menlo; font-size: 18px; color: rgb(187, 44, 162);" class="">let</span><span style="font-family: Menlo; font-size: 18px;" class="">&nbsp;partial1 = </span><span style="font-family: Menlo; font-size: 18px; color: rgb(49, 89, 93);" class="">projectFunctionToCoordinateSystem</span><span style="font-family: Menlo; font-size: 18px;" class="">(function: mySinFunction, p0: p0, p1: p1, x: $$)&nbsp;</span><span style="font-family: Menlo; font-size: 18px; color: rgb(0, 132, 0);" class="">// (x: CGFloat) -&gt; CGPoint</span></div><div class=""><br class=""></div>I find it a lot cleaner, less cruftyâ„¢ and nicer to use than jerry-rigging with a closure.</div></div></blockquote><br class=""></div><div>Closures having unlabeled arguments is a feature, IMO. Propagating labels through the function type system introduces type differences where there don't need to be.</div><div><br class=""></div><div>-Joe</div><br class=""></body></html>