[Pre-pre-RFC] "splatting" for named arguments and function overloading
Nadrieril:
Function overloading at home
Not really: the tuple trait is nightly only, and doesn't even have a tracking issue. So this only works inside std.
Nadrieril:
Named arguments at home
That doesn't work on stable as far as I know? Or did derive of Default become implicit recently? It would be helpful if you included the required #[feature] directives in your examples.
Nadrieril:
The syntax is
..ident: Typein function arguments, and is called "splatting".
I fear this will encourage awful APIs with dozens of arguments, as seen in C++ and Python (and maybe other languages, but those are the ones I'm most familar with that suffers from this).
Named arguments (struct case) are slightly better, but still have you seen some of the insane examples in popular python libraries? You tend to end up with lots of similar operations being stuffed into one function using 16 different optional arguments, like the proverbial square peg in the round hole.
I'm slightly opposed to this for named arguments, but strongly opposed to this for positional arguments. Especially since nothing seems to prevent you from accepting both (String, i8) and (i8, String) which leads to the full madness of C++ overloading.
That will be abused and lead to worse errors. We already see this with traits that are implemented for several different tuple lengths, like in axum. Rustc will list a number of "did you mean" but it is all useless (T), (T, U) etc, rather than what you were actually looking for.
Discussion in the ATmosphere