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

Immutability by default #64

Description

@sunjay

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions