zlox/samples/ch25_closures1.lox

13 lines
209 B
Plaintext

// this program should print "outer"; without proper closure support, it shows "global".
var x = "global";
fun outer() {
var x = "outer";
fun inner() {
print x;
}
inner();
}
outer();