<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br></div><div id="AppleMailSignature">if parameter names are obligatory, one could</div><div id="AppleMailSignature">remove the commas completely in the function call:</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature"> foo(a: v1 b: 123.45 c: qwertyuiop)</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">or alternatively with commas only:</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature"> foo( a v1, b 123.45, c 12 * 3 + 2)</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">TedvG</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature"><br><br></div><blockquote type="cite"><div><br><b>Subject:</b> <b>Make the first parameter in a function declaration follow the same rules as the others</b><br><br></div></blockquote><blockquote type="cite"><div><span>When I started using Swift (on the whole a pleasant journey)</span><br><span>the most confusing thing to me was, and at times still is, the parameter list,</span><br><span></span><br><span></span><br><span>I would prefer:</span><br><span></span><br><span>-uniform for functions(…) AND init(…)</span><br><span>-every parameter must be used with its name/label. Always, no exceptions.</span><br><span>-no shortcuts. </span><br><span>-allow arbitrary parameter sequence.</span><br><span>which is possible and very easy to implement when you always have to use names.</span><br><span>-no trailing commas.</span><br><span></span><br><span>Because you always have to specify parameter names/labels</span><br><span>it is easy to see (for the compiler) which parameters </span><br><span>are omitted.</span><br><span></span><br><span>Omitting a parameter for which no default value was </span><br><span>specified is still an error. </span><br><span></span><br><span>The confusing # and _ are no longer necessary. </span><br><span></span><br><span></span><br><span>‘inout’ and external and local parameter names behavior remain as they are.</span><br><span></span><br><span>like so</span><br><span></span><br><span> func foo(inout a: Type, b: Type = 12.34, c: Type) // b may be omitted</span><br><span> or</span><br><span> func foo(a alocal: Type, b blocal: Type = 12.34, c: Type= 3.14159) // b and c may be omitted </span><br><span></span><br><span></span><br><span> Valid calls:</span><br><span></span><br><span> foo(a: v1, b: v2, c: v3) // in sequence</span><br><span> foo(c: v3, a: v1, b: v3) // arbitrary parameter sequence is allowed.</span><br><span></span><br><span> foo(c: v13) // parms a and b are not present: default values wil be taken </span><br><span> // or error if no default specified.</span><br><span></span><br><span>Allow for more than 1 variadic parameter, why is this currently limited to one variadic parameter only? </span><br><span></span><br><span> foo(a: Type, b:Type…, c: Type…,d: Type)</span><br><span></span><br><span></span><br><span> foo(v1,b: v2,c: v3) // this is an error: parameter name missing with first parameter.</span><br><span></span><br><span></span><br><span>It would end the confusion.</span><br><span></span><br><span></span><br><span>TedvG</span><br><span></span><br></div></blockquote></body></html>