2021-12-29 02:09:51 +00:00
|
|
|
#lang scheme
|
|
|
|
|
|
|
|
; https://github.com/munificent/craftinginterpreters/blob/master/test/closure/reuse_closure_slot.lox
|
|
|
|
|
|
|
|
((lambda ()
|
|
|
|
(define f #f)
|
|
|
|
((lambda ()
|
|
|
|
(define a 1)
|
2021-12-29 02:32:43 +00:00
|
|
|
(define (f_)
|
|
|
|
(display a))
|
2021-12-29 02:09:51 +00:00
|
|
|
(set! f f_)))
|
|
|
|
|
|
|
|
((lambda ()
|
|
|
|
(define b 2)
|
|
|
|
(f)))))
|