While it's fine to think it through here, why do you start from scratch?

For example:

> var x = m is disallowed

No. Why? These are assignments are absolutely essential in order to be able to 
traverse a graph.

> I think we can make the var keep the second meaning (change the value rather 
> than the pointer, so we needn't pass the pointer of pointer for x: var T 
> parameter) only, and it has the same meaning as the value type.

Breaking the symmetry with what e.g. `var seq[T]` means is a bad idea and 
special rules like yours always come back to bite you in generic code.

> Then we need new syntax(like x: var mut T or other, I think it is rarely 
> used) to support the first meaning(pointer of pointer parameter).

But why? What problem does it solve? It's only syntax games. Forget the syntax 
for now. We have critical assignments and these take the form `p.field = value` 
where `p` is a parameter or a possible alias to a parameter. You need to 
disallow these critical assignments in order to ensure deep immutability 
without being overly conservative because otherwise you reject too much code 
that in reality keeps the immutability.

Reply via email to