Pre-RFC: Named arguments

Edited so as to adhere to community guidelines.

Firstly, I agree that having inferred struct literals would be a more robust solution.

But considering that:

  1. This is OP's first pre-RFC.

  2. The "typo" you refer to is not a typo.

  3. You can misspell struct field names just as easily, and then you can't fix the interface without violating backwards-compatibility either.

  4. You argue that using meaningful types is "correct design", yet standard library clearly doesn't use these consistently (using usize for indices being highly non-semantic, even limiting in that a special type could handle indexing from the end). I therefore feel like the main motivation isn't "correct design", but inertia.

  5. You argue that languages where named params make sense are all dynamically typed, clearly not considering Swift, C#, or Scala.

It's you being rude, not the OP. That you feel insulted by this post being duplicate of older ones - and complaining about it instead of eg. providing the links to the older posts - is something I don't get.

For information, some other posts about named arguments:

3 Likes