Closed LuKuangChen closed 2 years ago
A test program
#lang smol/dyn-scope-is-bad
(deffun (fibber x)
(if (< x 2)
(if (<= x 0) 0 1)
(+ (fibber (- x 1)) (fibber (- x 2)))))
(fibber 5)
The expected result is 5
Write these as tests, not just as "programs".
Fixed.
That is, the only place where the interpreter goes crazy is to fetch environment from the calling side rather than from the place where the closure is constructed.