How can I undefine a function in Clojure?

前端 未结 3 1068
你的背包
你的背包 2021-01-07 17:56

Often I need to undefine a function in clojure. If I define something with defn how can I undefine it?

3条回答
  •  没有蜡笔的小新
    2021-01-07 18:12

    If you have:

    (def x 42)
    

    It might be useful to unbind the var:

    (.unbindRoot #'x)
    

    Now, if you try this

    x
    

    You get:

    #
    

提交回复
热议问题