Skip to content
This repository has been archived by the owner on Feb 3, 2020. It is now read-only.

Immutability by default #64

Open
sunjay opened this issue Mar 12, 2017 · 0 comments
Open

Immutability by default #64

sunjay opened this issue Mar 12, 2017 · 0 comments

Comments

@sunjay
Copy link
Owner

sunjay commented Mar 12, 2017

Declarations should be immutable by default. To make them mutable, use the mut keyword as demonstrated below. This should be statically checked and enforced by the compiler.

let x: u8 = 19;
// Errors:
//x = 90;
//decrement(x);

let mut y: u8 = 17;
// Works:
y = 90;
decrement(y);

Started in #63.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant