Re:Rust 1.64.0
by kevincox on Thursday September 22, 2022 @01:32PM
(#32942081)
It gets awkward really fast when you may need to set a value.
[ Parent
| on HN ]
Would look very similar with named arguments, no?
Not if you do what Dart did: https://medium.com/dartlang/making-dart-a-better-language-fo...
Maybe. It depends a bit on how they are implemented. If there is a good way to pass "default" then you can just have a condition for that one argument. But if there is no way to pass "default" then it can get hairy.
For sure. I would like to see that in Rust as well, that would be nice. I am willing to put up with the lack of variadic & named arguments for the goodness the borrow checker brings me, but I can see how that would improve the ergonomics substantially.