You're viewing version 1.2.0 of ns-map. The latest stable version of Clojure Core is 1.3.0.
1.2.0 Arrow_down_16x16



  • (ns-map ns)
Returns a map of all the mappings for the namespace.

3 Examples top

  • (ns-map 'clojure.core)
    {sorted-map #'clojure.core/sorted-map, read-line #'clojure.core/read-line, re-pattern #'clojure.core/re-pattern, keyword? #'clojure.core/keyword?, ClassVisitor clojure.asm.ClassVisitor, asm-type #'clojure.core/asm-type, val #'clojure.core/val, ...chop...}
  • ;; See also for information on namespaces in Clojure and how to inspect and manipulate them
  • ;; ns-map = ns-refers + ns-interns + ns-imports
    user=> (count (ns-imports *ns*))
    ;;=> 96
    user=> (count (ns-interns *ns*))
    ;;=> 2
    user=> (count (ns-refers *ns*))
    ;;=> 590
    user=> (+ *1 *2 *3)
    ;;=> 688
    user=> (count (ns-map *ns*))
    ;;=> 688
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:3216 top

(defn ns-map
  "Returns a map of all the mappings for the namespace."
  {:added "1.0"}
  (.getMappings (the-ns ns)))
Vars in clojure.core/ns-map: defn ns the-ns
Used in 4 other vars ns-publics ns-interns ns-refers ns-imports

Comments top

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