Fork me on GitHub
#vim
<
2021-03-30
>
Noah Bogart21:03:19

quick vim-iced question: I have a namespace that refers a function from another namespace. i want to move that function into this namespace. so i delete it from the other file, copy it into this file, remove the :refer part of the ns macro, and then use vim-iced to evaluate the function definition in the new file/namespace.

Noah Bogart21:03:24

however, this throws the error CompilerException java.lang.IllegalStateException: private-card already refers to: #'game.core.card/private-card in namespace: game.core.diffs

Noah Bogart21:03:36

i solved it by using the repl to run (ns-unmap *ns* 'private-card), and then reevaluate the function, but that feels messy

noisesmith00:03:37

from clojure's point of view your options are the ns-unmap, or to delete and recreate the entire ns

noisesmith00:03:40

(I might be wrongheaded about this, but to me the clojure specific solution (delete the var or ns) is simple enough that binding it to editor shortcuts is just obfuscation - it is almost as if it's imitating the hoops you need to jump through in a language that isn't dynamic and introspective)

👍 3