Skip to content

Make language more precise in variable mutability design doc #509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

catamorphism
Copy link
Collaborator

The existing proposal uses the term "mutability" to describe a situation where variables aren't being mutated. I've rewritten the document to refer to name shadowing rather than mutability. As we discussed in issue 413, mutability is not on the table; the question is whether to allow shadowing (overriding) or not.

(I've used "name shadowing" in most cases since the term "override" can easily be confused with "overwrite".)

@catamorphism catamorphism force-pushed the variable-mutability-edits branch from d6814f1 to 9bc20f2 Compare October 31, 2023 23:20
Comment on lines 33 to 34
The term **external variable** refers to a value that is passed to the
message formatter by name and which can be referred to in an expression.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the changes you've proposed, I think this part ought to be revisited as well. Given that the chosen solution is to use input and local declarations, the definitions here of "local" and "external" variables don't necessarily align all that well. Maybe we'd be better off with "local", "input", and "implicit" variables as separate concepts?

Overall, though, I'm not excessively keen on spending too much time on this, esp. given that the corresponding changes have already been applied to the spec. If there are issues with any of that text, that should definitely be prioritised. The remaining value of this doc is to provide some explanation of our decisions for later really interested readers.

@catamorphism
Copy link
Collaborator Author

I'm going to close this, since the actual spec text doesn't mention mutability, as far as I can tell. (If I see something else that's in the final spec, I'll open another PR.)

@aphillips
Copy link
Member

Variables are not mutable with the changes that brought in local and input.

(Good to see you able to contribute again!!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants