diff options
| author | Andrey Listopadov <andreyorst@gmail.com> | 2022-10-30 11:51:28 +0300 |
|---|---|---|
| committer | Andrey Listopadov <andreyorst@gmail.com> | 2022-10-30 11:51:28 +0300 |
| commit | 5232de8401af5fe1ebcd9f5fcdbee9e5c2b90051 (patch) | |
| tree | f16383b168a20103ca9f244c268b35ee47966fd7 /init-macros.fnl | |
| parent | 1e445990065936a07cf1e33be2ea5c48799ac289 (diff) | |
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.
Diffstat (limited to 'init-macros.fnl')
| -rw-r--r-- | init-macros.fnl | 2 |
1 files changed, 1 insertions, 1 deletions
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#) |