<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 style=""> callSomething(callback: (test: (arg: </span><span style="color:rgb(112,61,170)">Int</span><span style=""> = </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 style=""> callback(test: { </span><span style="color:rgb(61,29,129)">print</span><span style="">($0) })</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">}</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span style=""></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 style=""> test(</span><span style="">)</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">}</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 style=""><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>