Add test for atoms "leaking" out of let* binds
authorAli Mohammad Pur <Ali.mpfard@gmail.com>
Wed, 15 Jan 2020 21:25:12 +0000 (00:55 +0330)
committerGitHub <noreply@github.com>
Wed, 15 Jan 2020 21:25:12 +0000 (00:55 +0330)
(hopefully) closes #490

tests/step6_file.mal

index 939396c..5eecc33 100644 (file)
 (f)
 ;=>9
 
+;; Testing whether closures can retain atoms
+(def! g (let* (atm (atom 0)) (fn* () (deref atm))))
+(def! atm (atom 1))
+(g)
+;=>0
+
 ;>>> deferrable=True
 ;;
 ;; -------- Deferrable Functionality --------