<div dir="ltr"><div class="markdown-here-wrapper" style=""><p style="margin:0px 0px 1.2em!important">+1 to <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">foo(:)</code> version.<br>I can easily see placeholder arguments as a sugary syntax for closures:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important">func bar(_ x: Int, _ y: Double)
let f = bar(_, 42)   // the same as:
let f = { (x: Int) in bar(x, 42) }
</code></pre><p style="margin:0px 0px 1.2em!important">Now, let’s view a single-parameter version:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important">func foo(_ x: Int)
let f = foo(_)   // the same as:
let f = { (x: Int) in foo(x) }
</code></pre><div title="MDH:KzEgdG8gYGZvbyg6KWAgdmVyc2lvbi48ZGl2PkkgY2FuIGVhc2lseSBzZWUgcGxhY2Vob2xkZXIg
YXJndW1lbnRzIGFzIGEgc3VnYXJ5IHN5bnRheCBmb3IgY2xvc3VyZXM6PC9kaXY+PGRpdj48YnI+
PC9kaXY+PGRpdj5gYGA8L2Rpdj48ZGl2PmZ1bmMgYmFyKF8geDogSW50LCBfIHk6IERvdWJsZSk8
L2Rpdj5sZXQgZiA9IGJhcihfLCA0MikgwqAgLy8gdGhlIHNhbWUgYXM6PGRpdj5sZXQgZiA9IHsg
KHg6IEludCkgaW4gYmFyKHgsIDQyKSB9PC9kaXY+PGRpdj5gYGA8L2Rpdj48ZGl2Pjxicj48L2Rp
dj48ZGl2Pk5vdywgbGV0J3MgdmlldyBhIHNpbmdsZS1wYXJhbWV0ZXIgdmVyc2lvbjo8L2Rpdj48
ZGl2Pjxicj48L2Rpdj48ZGl2PmBgYDwvZGl2PjxkaXY+ZnVuYyBmb28oXyB4OiBJbnQpPC9kaXY+
PGRpdj5sZXQgZiA9IGZvbyhfKSAmbmJzcDsgLy8gdGhlIHNhbWUgYXM6PC9kaXY+PGRpdj5sZXQg
ZiA9IHsgKHg6IEludCkgaW4gZm9vKHgpIH08L2Rpdj48ZGl2PmBgYDwvZGl2Pg==" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0">​</div></div></div>