rascal
rascal copied to clipboard
local variable declarations not "sequential", breaks REPL and Rascal Notebook
Describe the bug
rascal>int a = 1;
int: 1
rascal>int a = 2;
|prompt:///|(4,5,<1,4>,<1,9>): Redeclared variable: a
This is not so problematic for short-lived REPLs because we can always come up with a different name, but it does break the Bacatá notebook interface if you press the "play" button on the same cell twice. As explained the Onward! paper, this kind of variable reservation semantics is not "sequential" because [| int a = 1; int a = 2; |] != [| int a = 1; |] o [| int a = 2 |];
The proposal would be that top-level re-declarations lead to overwrites rather than static errors. The result on the REPL would be:
rascal>int a = 1;
int: 1
rascal>str a = "2";
str: 2