Skip to content
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

Outer Mutability #28

Merged
merged 3 commits into from Feb 22, 2023
Merged

Outer Mutability #28

merged 3 commits into from Feb 22, 2023

Conversation

H1ghBre4k3r
Copy link
Owner

This PR aims to allow outer mutability (i.e., allow mutations of variables which are not defined within the inner scope).

To achieve that, I added the mut keyword. If a definition is parsed with a mut keyword, the parser marks the corresponding definition as "mutable". The TypeScope got adjusted to keep track of that.

Closes #24

@H1ghBre4k3r H1ghBre4k3r added the enhancement New feature or request label Feb 21, 2023
Copy link
Collaborator

@fwcd fwcd left a comment

Choose a reason for hiding this comment

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

I'm not super familar with the definition/typechecking machinery, so I can't comment on that, but otherwise this looks pretty good, I would say.

A minor typo/nit below.

tests/mutable.rs Outdated Show resolved Hide resolved
tests/mutable.rs Outdated Show resolved Hide resolved
@H1ghBre4k3r H1ghBre4k3r merged commit 058037e into main Feb 22, 2023
@H1ghBre4k3r H1ghBre4k3r deleted the outer-mutability branch February 22, 2023 08:03
@H1ghBre4k3r H1ghBre4k3r added this to the V0.1.0 milestone Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Outer Mutability
2 participants