> 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.