by mostly_harmless · 12y ago · 0 comments
Additionally, specifying that the RValue "[1,2]" has mutability is meaningless. The expression "[1,2]" is represented as a constant until it is stored in a variable (it should be represented in the MACH-O constant data section). It is the variable which has the concept of mutability.
The proposal is similar to proposing the following declaration in C:
"int i = const 1;"
Which is meaningless, because the '1' can never be not-const
The immutability of the binding and that of the value are different concerns. let and var are about the binding's mutability, trying to munge them together only ends up in tears.
> The proposal is similar to proposing the following declaration in C:
No. The proposal is similar to the following C:
int const * i;