<div dir="ltr"><div>Right now Swift provides shorthand argument names ($0, $1 etc) by default which could be overriden with more specific names. I think it would be nice to define our own default names as part of type definition:<br></div><div><br></div><div>typealias Closure = (first one: String, second two: String) -&gt; Void</div><div><br></div><div>func executeClosure(closure: Closure) {</div><div><span class="" style="white-space:pre">        </span>// the caller uses external parameter names, nothing changed here </div><div><span class="" style="white-space:pre">        </span>closure(first: &quot;first&quot;, second: 2)</div><div>}</div><div><br></div><div>executeClosure {</div><div><span class="" style="white-space:pre">        </span>// the callee uses custom arguments instead of $0, $1</div><div><span class="" style="white-space:pre">        </span>// also it is possible to override these names here as usual </div><div><span class="" style="white-space:pre">        </span>print(&quot;one \(one) two \(two)&quot;)</div><div>}</div><div><br></div><div>This feature is backward compatible in that way what both</div><div><br></div><div>typealias Closure = (first: String, second: String) -&gt; Void </div><div><br></div><div>and</div><div><br></div><div>typealias Closure = (String, String) -&gt; Void</div><div><br></div><div>will provide the same behavior like now.</div><div><br></div><div>Possible applications: providing default argument names more meaningfull than $0, $1, DSL-like constructions.</div><div><br></div><div>Possible problem: names could overlap. Nothing new. $0, $1 could overlap too. Override argument names or variable names in a scope.</div></div>