4 ms·
In my limited C# experience I found `int?` to be really nice, and an operator to non-null it sounds even nicer. I wonder if there is any chance of Rust getting
by pjungwir 12y ago
In my limited C# experience I found `int?` to be really nice, and an operator to non-null it sounds even nicer.
I wonder if there is any chance of Rust getting an abbreviation like `?` so you can write `int?` instead of `Option<int>`. I'm just starting to explore the language, but it seems like a lovely addition.
- mytochar 12y agoRust's syntax has actually been getting more wordy and less variable-y. At least, that's what happened when the changed around Box and some other syntax-sugar'd variables. I wouldn't expect Rust to go back to shorthand after leaving it.
- bjz_ 12y agoRust is trying to reduce the amount of magic in the libraries as much as possible. This means that whatever the language/standard library authors have available to them, third party library authors should also have access to. `T?` would probably run against that, given the previous removal of `@T`, `~T`, `~T`, and `~str` in favor of `Gc<T>`, `Box<T>`, `Vec<T>`, and `String`.