ns-map

clojure.core

  • (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 http://clojure.org/namespaces 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:3698 top

(defn ns-map
  "Returns a map of all the mappings for the namespace."
  {:added "1.0"
   :static true}
  [ns]
  (.getMappings (the-ns ns)))
Vars in clojure.core/ns-map:
Used in 0 other vars

Comments top

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