skx / yal

Yet another lisp interpreter
GNU General Public License v2.0
16 stars 0 forks source link

Closures / Environments need work. #129

Open skx opened 1 year ago

skx commented 1 year ago

Closures don't work as they should:

(set! foo 1)

(set! bar (fn* ()
   (set! foo (+ foo 1) true)
   foo))

(set! foo 99)

(print "Value should be two: %d" (bar))

As the environment was not built into the function, and used, the value is actually output as 100.