handball/src/test/run-pass/closure/shadow-closure-with-local.scm

16 lines
413 B
Scheme
Raw Normal View History

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
(define (displayln x)
(display x)
(newline))
2021-12-29 02:09:51 +00:00
((lambda ()
(define foo 0)
(define (f)
2021-12-29 02:09:51 +00:00
((lambda ()
(displayln foo)
(define foo 1)
(displayln foo))))
(f)))