You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following program, entered statement by statement in separate cells into the REPL when using js-slang --variant=explicit-control, returns error "Name a not declared."
consta=1;constb=1;constc=a;
Any reference to a after const b = 1 returns an error.
The same behaviour can be seen with replacing const b = 1; with an IIFE such as (x => x)(a); - after the IIFE, a is not found.
I suspect this has to do with the way the current environment is handled (as an array of environments in context.runtime.environments).
The text was updated successfully, but these errors were encountered:
martin-henz
changed the title
CSE Machine: Scoping issues in REPL when using explicit control variants
Scoping issues in REPL when using explicit control variants
Mar 5, 2024
The problem persists, as functions defined using preludes are "forgotten" with each new program execution.
The following program, entered statement by statement in separate cells into the REPL when using js-slang --variant=explicit-control, returns error "Name map not declared."
The following program, entered statement by statement in separate cells into the REPL when using
js-slang --variant=explicit-control
, returns error "Name a not declared."Any reference to a after
const b = 1
returns an error.The same behaviour can be seen with replacing
const b = 1;
with an IIFE such as(x => x)(a);
- after the IIFE, a is not found.I suspect this has to do with the way the current environment is handled (as an array of environments in
context.runtime.environments
).The text was updated successfully, but these errors were encountered: