(import stdlib)
(using-namespace std
(def main (fn extern-c void (void)
(def var (var intern int 0)) ;if this is a global variable, it works
(let ((fun \ (fn void (void)
(incv var)
(return))))
(fun)
(fun))))
)
This is now fixed. Anonymous functions should not have access to any variables outside their own scope, including variables defined within the function in which the anonymous function is defined.
example: