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

Toplevel let in self-hosted REPL should be visible to subsequent expressions #912

Open
nikodemus opened this issue Mar 31, 2022 · 0 comments
Labels
blocker Prevents current milestone from being reached bug-lang Language level bug

Comments

@nikodemus
Copy link
Owner

> let a = 10
10
> a * 2
10

Today the first expression is refused since let expects a dot after the binding, and even if there was something after it, the binding isn't visible afterwards.

The approximate shape of this fix seems to be:

  • Handle toplevel lets specially in parser. This means they can get their own syntax and AST nodes as well.
  • Represent the toplevel environment in REPL so that there's a dictionary of mutable variables.
@nikodemus nikodemus added bug-lang Language level bug blocker Prevents current milestone from being reached labels Mar 31, 2022
@nikodemus nikodemus added this to the 0.2: self-hosting milestone Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker Prevents current milestone from being reached bug-lang Language level bug
Projects
None yet
Development

No branches or pull requests

1 participant