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

Official Documentation

Add notes
Arities
==================================================
   [x]

Docstring
==================================================
  If passed a namespace, returns it. Else, when passed a symbol,
  returns the namespace named by it, throwing an exception if not
  found.

Source

(defn the-ns
  "If passed a namespace, returns it. Else, when passed a symbol,
  returns the namespace named by it, throwing an exception if not
  found."
  {:added "1.0"
   :static true}
  ^clojure.lang.Namespace [x]
  (if (instance? clojure.lang.Namespace x)
    x
    (or (find-ns x) (throw (Exception. (str "No namespace: " x " found"))))))

Example 1

Edit
;; Let's play with a namespace by its name and by its symbol 
(def for-later-use (create-ns 'my-namespace))
;; => #'user/for-later-use

(the-ns for-later-use)
;; => #<Namespace my-namespace>

(the-ns 'my-namespace)
;; => #<Namespace my-namespace>

;; not going to find anything this way because we just asked the repl
;; not to perform an evaluate on it and there is not such 
;; namespace with the name "for-later-use"
(the-ns 'for-later-use)
;; => java.lang.Exception: No namespace: for-later-use found (NO_SOURCE_FILE:0)

;; not going to work either because "my-namespace" is the name of a namespace
;; and not a symbol that points to something
(the-ns my-namespace)
;; => java.lang.Exception: Unable to resolve symbol: my-namespace in this context (NO_SOURCE_FILE:12)

Uses on crossclj