<div dir="ltr">What would this help you express? It is fairly difficult to read the type and understand your motivation from this reduced example. It is clear what you want but not what it wins you or us.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 14, 2016 at 3:40 AM, Andrew Bennett 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 dir="ltr">I'd like to be able to do this:<div><br></div><div><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="color:rgb(187,44,162)">func</span><span> callSomething(callback: (test: (arg: </span><span style="color:rgb(112,61,170)">Int</span><span> = </span><span style="color:rgb(39,42,216)">4</span>) -> <span style="color:rgb(112,61,170)">Void</span>) -> <span style="color:rgb(112,61,170)">Void</span>) {</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span> callback(test: { </span><span style="color:rgb(61,29,129)">print</span><span>($0) })</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span>}</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span></span><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="color:rgb(49,89,93)">callSomething</span><span style="color:rgb(0,0,0)"> { test </span><span style="color:rgb(187,44,162)">in</span><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span> test(</span><span>)</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span>}</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><br></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span><br></span></p></div><div>Ideally the default argument would be part of the closure's type signature.</div><div><br></div><div>If-not then it could be part of callSomething's signature, and it could lose the defaulted arguments if passed around.</div><div><br></div><div>What do you think?</div><div><br></div></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>