sunjay / brain

A high level programming language that compiles into the brainfuck esoteric programming language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Immutability by default

sunjay opened this issue · comments

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.