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

Draft: Add variable definitions via let #110

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

leftshift
Copy link
Contributor

@leftshift leftshift commented Aug 28, 2021

As came up in #104, i took a look at adding variable definitions via let x = expr.

Still some things to figure out:
Right now, it's possible to set variables to names which then are inaccessible because they are masked by a unit with the same name.
I'd like to probably change lookup slightly so it also returns the type of the lookup result, so before setting a variable, we can check whether there already is something other than a variable with this name and refuse. I think silently redefining variables with another let is fine, though.

Again, any thoughts or ideas are appreciated :)

@leftshift
Copy link
Contributor Author

Oops, broke the tests /o\

I actually took a quick look at the tests when working on #104 and wanted to add a test for accessing the previous result, but couldn't figure out how to make the thread local context also mutable...
It might also make sense to refactor these tests to use lib::eval()?

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.

None yet

1 participant