On 1/31/14 8:24 PM, Eric Summers wrote:
I’m new to Rust (three days), but I thought the mut syntax felt odd in a few 
places.  Type definitions in particular because it is one of the few places 
that require padding.  Is there any reason a symbol isn’t used for mutability 
instead?  Forgive me if I’m too naive in Rust.

With a symbol you can drop the space:
fn drop(&mut self) { .. } <-> fn drop(&!self)

The only other common situation I've seen so for that require the space are 
lifetime annotations.  Maybe there is an alternate form for those?

The symbol could probably be extended to let:
let mut a = 0; <-> let !a = 0; <-> let a: !u32 = 0;
or maybe mutable setter;
let a := 0;

As other said, I think ‘var' sugar feels against the design of the language.

    let !a = 0 is ambiguous with macros. (cf. `let! a = 0;`)

Patrick

_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to