<html><body><div>I could probably live without commas between lines but I consider having only whitespace between parameters on the same line to be horribly unreadable (your example 3).<br></div><div><br data-mce-bogus="1"></div><div>-Thorsten<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div><br>Am 14. März 2016 um 22:34 schrieb "Ted F.A. van Gaalen via swift-evolution" <swift-evolution@swift.org>:<br><br><div><blockquote type="cite"><div class="msg-quote"><div class="_stretch"><span class="body-text-content">(spawned from subject: "Make the first parameter in a function follow the same rules as the others”)<br><br>Idea: Eliminate commas from the parameter list when calling a function, because they are not necessary. <br><br>Function declaration as they ares now need not to be changed. <br> (including (as recently proposed by others) that the 1st parameter now has the same rules as the other parameters).<br><br>I’ve dropped the thought of an arbitrary parameter sequence (when calling.)<br>because this is only possible when all parameters are named,<br>which seems to be what many people don’t want.<br><br>Removing the commas as separators from the parameter list and instead <br>regarding space(s) and also linefeeds as separators has significant advantages:<br><br> - it is possible to use multiple variadic parameters <br> - there is no obligation to put a variadic sequence at the end of the parameter list.<br> - it looks cleaner and is more readable. <br> - easier and faster to type. <br><br><br>Some examples:<br> <br>1. Calling a function with all parameters labeled:<br><br> foo( a: thing // The colon : always signifies that it is a label, not a var/value<br> b: 12,45, 65, 56, 456 // b and c are variadic. .<br> c: “aeroplane”, ”car”, ”rocket” <br> d: temperature ) <br><br> // The commas embedded in variadic parameters are not interpreted as parameter separators! <br><br>2. Calling a function with the first two parameters unlabeled: <br><br> fooWithThing( thing <br> 12, average(12,6,36), 45, 65, 56, 456 // this line is just one variadic parameter <br> c: “aeroplane”, ”car”, ”rocket” // yet another variadic parameter<br> d: temperature ) <br> <br><br>3. Calling a function where all labels are omitted (but not in the embedded function here)<br><br> setFlightVector( 10.0 34.5 ascend( horizon: 7.99 at: altitude ) plane: dc[3] ) <br><br><br>Note that spaces embedded in a variadic row do not cause problems<br>because the variadic items must be connected by embedded commas. <br><br>As far as I can see, this should be possible.<br>Unless there would be problems / conflicts with other Swift<br>language usage or components? <br>I hope that I am not missing something. <br><br>btw: The problem with variadic parameters would not be<br>there if instead of this a collection type e.g. array would be passed.<br>However, I understand that for calls to legacy functions, this cannot<br>be removed? I’d suggest this could be easily solved with a <br>keyword or special builtin function e.g. like so: <br><br> fooWithVariadic( a: 12.34 <br> variadic(12 34 534 65 56) <br> c: “Moon” ) <br>or so:<br><br> fooWithVariadic( a: 12.34 …(72 37 aNumber 65 * 56) c: “Saturn” ) // … has 4 values here.<br><br><br>Kind Regards<br>TedvG<br><br><br><br><br>_______________________________________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" data-mce-href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" data-mce-href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></span></div></div></blockquote></div></div></body></html>