The issue is that this stage actually also tests for closures.
I haven’t implemented them yet as I’m not looking up upvalues when ‘compiling’ (I’m in C, and kinda implementing the interpreter as a VM and not an AST walker)
In Test case 3: the
makeAdder
function returns an add
function, which captures the variable x
from makeAdder
, this is a closure, and it doesn’t seem like you should be testing closures here, as the last stage in the extension “FUNCTIONS” #GG6 is named “Closures”.