chuigda-wasteland / doc47

Documentation for the Pr47 language
7 stars 0 forks source link

I0014: Vote: which would you prefer, const by default or mutable by default? #16

Open chuigda opened 3 years ago

chuigda commented 3 years ago

We're now thinking about introducing some mechanism like "constness restriction on parameters" or so. Should we make parameters constant by default like Rust, or mutable by default like C++?

Note: People writing Pr47 may not be the same as people who write Rust functionalities for Pr47.

Vote

:heart: => constant by default and requires mut :rocket: => mutable by default and requires const :laughing: => neither is default and always require mut/const :confused: => not having idea on this :-1: => we don't need constness restrictions

HoshinoTented commented 3 years ago

👍 => we don't need mutability restrictions

chuigda commented 3 years ago

Хорошо

:+1: => we don't need mutability restrictions

imlyzh commented 3 years ago

we need let and var keyword, correspond immutable var and mutable var;

var b = 1;
b = 2; // ok

let a = 1;
a = 2; // error

let a = 1;
let a = 2; // ok
chuigda commented 3 years ago

Looks like most people wants immutable by default. I'll then implement this.