diff --git a/compile.rkt b/compile.rkt index fb5e2cb..cebbf94 100644 --- a/compile.rkt +++ b/compile.rkt @@ -89,7 +89,7 @@ [(InstallValue? exp) (loop (InstallValue-body exp) cenv)] [(BoxEnv? exp) - '()] + (loop (BoxEnv-body exp) cenv)] [(LetRec? exp) (let ([new-cenv (append (map (lambda: ([p : Lam]) (extract-static-knowledge diff --git a/test-compiler.rkt b/test-compiler.rkt index 701163f..c42fefe 100644 --- a/test-compiler.rkt +++ b/test-compiler.rkt @@ -790,6 +790,14 @@ #:control-limit 3) +(test '(begin (define counter + (let ([x 0]) + (lambda () + (set! x (add1 x)) + x))) + (list (counter) (counter) (counter))) + '(1 2 3)) +