Thanks everyone for your inputs. I will close this proposal soon and resubmit it without mentioning mutability. There are two aspects to decide:
-
What should we call them? Local state? Local accumulators?
-
We definitely need explicit syntax to declare them, such as the
mut“keyword”, do we also need explicit syntax to reassign them? I am personally undecided. F# does use a different syntax, as @billylanchantin mentioned, but in F# it is literally mutable and it crosses the local scope, which is why you need a different syntax. One of the reasons to not have different syntax is: what if you write{foo, bar} = some_fun()wherefoois a mutable (as in this proposal) butbaris not? Using a separate operator would not capture this nuance. Using a sigil such as$foois an alternative but it has a much bigger footprint on the language. Anyway, we don’t need to decide this now, but it is food for thought.
I’d say only here is a red herring, readability is extremely important and it should be enough reason. ![]()






















