From 5232de8401af5fe1ebcd9f5fcdbee9e5c2b90051 Mon Sep 17 00:00:00 2001 From: Andrey Listopadov Date: Sun, 30 Oct 2022 11:51:28 +0300 Subject: check if namespace symbol is in scope before binding Prevents the situation when cljlib was loaded in the REPL which had a side effect on setting the compile-time `current-ns` variable, and thus affected the REPL too, resulting in such macros like `def` and its variants trying to bind to a non-existent namespace. --- init-macros.fnl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init-macros.fnl b/init-macros.fnl index 7ee918b..3efed1c 100644 --- a/init-macros.fnl +++ b/init-macros.fnl @@ -149,7 +149,7 @@ string is given, it's value is set to `true` in the meta table." [{:private true} name val])) `(local ,name ,val) [name val] - (if current-ns + (if (in-scope? current-ns) `(local ,name (let [v# ,val] (tset ,current-ns ,(tostring name) v#) -- cgit v1.2.3