2 ms·
They're not required, they just default to having a name. You can tell the compiler you don't want a name, and it works: func f(a: Int)(_ b: Int)(_ c: Int)
by mikeash 12y ago
They're not required, they just default to having a name. You can tell the compiler you don't want a name, and it works:
func f(a: Int)(_ b: Int)(_ c: Int) -> Int { return a + b + c }
let v = f(2)(5)(5)
The rules for what gets an externally visible name automatically are pretty weird, to be sure. But it's easy to have it do what you want if you don't want the default.