Same thing can be rewritten as `let i = from_str::<uint>("42")` without compromising any type strictness Rust is proud of. In this form RHS expression has clear unambiguous type and can be copied anywhere. But this is discouraged form. More than that, when I was pointing out ugly template syntax, I got some comments that it is OK exactly because you are always supposed to put type on LHS. This is purely matter of style decisions and it sucks hard.
Re: User defined properties signatures
Dicebot via Digitalmars-d-learn Tue, 21 Apr 2015 10:06:07 -0700
This isn't about type system per se but about preferred style of
syntax. Original example that caused my hatred looked like this:
`let i : uint = from_str("42")`. Fortunately this has been
deprecated in favor of `parse` but same principle applies - Rust
authors encourage you to use declaration for type deduction
instead of expression.
- User defined properties signa... dvic via Digitalmars-d-learn
- Re: User defined propert... Jonathan M Davis via Digitalmars-d-learn
- Re: User defined propert... Ali Çehreli via Digitalmars-d-learn
- Re: User defined propert... Steven Schveighoffer via Digitalmars-d-learn
- Re: User defined propert... dvic via Digitalmars-d-learn
- Re: User defined pro... Jonathan M Davis via Digitalmars-d-learn
- Re: User defined pro... dvic via Digitalmars-d-learn
- Re: User defined pro... via Digitalmars-d-learn
- Re: User defined... Dicebot via Digitalmars-d-learn
- Re: User def... Idan Arye via Digitalmars-d-learn
- Re: Use... Dicebot via Digitalmars-d-learn