Often I need to undefine a function in clojure. If I define something with defn how can I undefine it?
Clojure doesn't have an explicit return statement. Instead, Clojure will return the result of the last form evaluated in a function (a form is just a valid piece of code).
It's a way to write code left to right, instead of inside out, e.g. (reduce (map (map xs bar) foo) baz) becomes (-> xs (map bar) (map foo) (reduce baz))
There is no one-argument version, because the same Var can be mapped in more than one namespace. If you are working from the REPL, you often want to unbind from the user namespace, e.g.
(ns-unmap 'user 'symbol-to-unbind)
The first argument to ns-unmap can be a symbol or a namespace, and the second argument should be a symbol.
I think, that you can use ns-unmap to do this.
P.S. Couldn't add this code into comment, so i put it here. To unmap function in current namespace, you need to use following code:
(ns-unmap *ns* 'method)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With