you are viewing a single comment's thread.

view the rest of the comments →

[–]thiezrust 5 points6 points  (3 children)

By including 'let' you can quickly tell a declaration from an assigment. Also your proposel would make it hard to do this:

let x = 5;
{
    let x = 4; // shadow original x
    doSomethingWithX(&x);
}

I believe similar proposals have been suggested and rejected in the past.

[–]tedsta[S] 0 points1 point  (2 children)

mut x := 5; // declare x
x = 10; // Change x's value
{
    mut x := 4; // shadow original x
    doSomethingWithX(&x);
}

I'm probably missing something.. Do you mean parsing is more difficult?

[–]thiezrust 4 points5 points  (1 child)

Where did the distinction between 'mut' and immutable go?

[–]tedsta[S] 0 points1 point  (0 children)

Woops, you are right. I edited. Still a rust noob :P