2021-12-29 02:09:51 +00:00
|
|
|
; https://github.com/munificent/craftinginterpreters/blob/master/test/closure/shadow_closure_with_local.lox
|
|
|
|
; TODO: Forbid this https://discordapp.com/channels/571040468092321801/618895179343986688/925533402592079912
|
|
|
|
|
2021-12-29 02:32:43 +00:00
|
|
|
(define (displayln x)
|
|
|
|
(display x)
|
|
|
|
(newline))
|
2021-12-29 02:09:51 +00:00
|
|
|
|
|
|
|
((lambda ()
|
|
|
|
(define foo 0)
|
2021-12-29 02:32:43 +00:00
|
|
|
(define (f)
|
2021-12-29 02:09:51 +00:00
|
|
|
((lambda ()
|
|
|
|
(displayln foo)
|
|
|
|
(define foo 1)
|
2021-12-29 02:32:43 +00:00
|
|
|
(displayln foo))))
|
|
|
|
(f)))
|