The CSE machine currently does not inject an environment instruction into the control when a function application or a block statement is the last item in a program. While this works for a single program, it breaks the REPL, where each submitted code snippet is treated as a singular program. The best way to deal with this issue is to force an environment instruction for any environment-producing statements at the end of the program to allow for newer REPL snippets to read from the correct environment.
The CSE machine currently does not inject an environment instruction into the control when a function application or a block statement is the last item in a program. While this works for a single program, it breaks the REPL, where each submitted code snippet is treated as a singular program. The best way to deal with this issue is to force an environment instruction for any environment-producing statements at the end of the program to allow for newer REPL snippets to read from the correct environment.
Resolves #1576.