You're viewing version 1.2.0 of remove-ns. The latest stable version of Clojure Core is 1.3.0.
1.2.0 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:3189 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"}
  [sym] (clojure.lang.Namespace/remove sym))
Vars in clojure.core/remove-ns: defn

Comments top

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