Closed ppk03 closed 4 months ago
Since variable redifinition is allowed in Lox, this code seems to be valid:
fun scope(a) { // put "a" into environment var a = "local"; // redefine is allowed } var a = "global"; scope(a);
Lox only allows redefining top level global variables, not locals.
This really solve my question, thanks.
Since variable redifinition is allowed in Lox, this code seems to be valid: