store/[org.clojure/clojure "1.8.0"] clj::clojure.core/ns-unalias

Community Documentation

Edit

Arities

[ns sym] -> nil

Usage

Removes an alias for another namespace from the target namespace.

Note that aliases are not mappings. Aliases are abbreviations for other namespaces created by clj::clojure.core/alias

This is distinct from a binding of s created via (def s ...), which is said to be a mapping, see clj::clojure.core/ns-unmap

Source

(defn ns-unalias
  "Removes the alias for the symbol from the namespace."
  {:added "1.0"
   :static true}
  [ns sym]
  (.removeAlias (the-ns ns) sym))

Example 1

Edit
;; You are having a problem loading a redefined namespace:
(load "src/clj/com/tizra/layout_expander.clj")
;; => #<IllegalStateException java.lang.IllegalStateException: Alias xml already exists in namespace com.tizra.layout-expander, aliasing com.tizra.xml-match>

;; ns-unalias to the rescue!
(ns-unalias (find-ns 'com.tizra.layout-expander) 'xml)
;; => nil

(load "src/clj/com/tizra/layout_expander.clj")
;; => #'com.tizra.layout-expander/junk

Uses on crossclj