[swift-evolution] Pitch: Compound name `foo(:)` for nullary functions

Anton Zhilin antonyzhilin at gmail.com
Thu Feb 23 12:52:26 CST 2017


+1 to foo(:) version.
I can easily see placeholder arguments as a sugary syntax for closures:

func bar(_ x: Int, _ y: Double)
let f = bar(_, 42)   // the same as:
let f = { (x: Int) in bar(x, 42) }

Now, let’s view a single-parameter version:

func foo(_ x: Int)
let f = foo(_)   // the same as:
let f = { (x: Int) in foo(x) }

​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170223/215b5589/attachment.html>


More information about the swift-evolution mailing list