1.3.0 permalink Arrow_down_16x16

remove-ns

clojure.core

  • (remove-ns sym)
Removes the namespace named by the symbol. Use with caution.
Cannot be used to remove the clojure namespace.

1 Example top

  • ;; Let's create a namespace and then remove it
    
    user=> (create-ns 'my-new-namespace)
    #<Namespace my-new-namespace>
    
    ;; removing a namespace will give you the namespace you just deleted, if one existed
    user=> (remove-ns 'my-new-namespace)
    #<Namespace my-new-namespace>
    
    ;; removing a namespace that does not exist, will tell you that nothing was removed, 
    ;; by returning nil, and won't give any errors
    user=> (remove-ns 'my-new-namespace)
    nil
    
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core.clj:3667 top

(defn remove-ns
  "Removes the namespace named by the symbol. Use with caution.
  Cannot be used to remove the clojure namespace."
  {:added "1.0"
   :static true}
  [sym] (clojure.lang.Namespace/remove sym))
Vars in clojure.core/remove-ns:
Used in 0 other vars

Comments top

No comments for remove-ns. Log in to add a comment.