ns-interns

clojure.core

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

2 Examples top

  • user=> (take 2 (ns-interns `clojure.core))
    ([sorted-map #'clojure.core/sorted-map] [read-line #'clojure.core/read-line])
    
    user=> (take 5 (sort (keys (ns-interns `clojure.java.io))))
    (Coercions IOFactory append? as-file as-relative-path)
    
    user=> (count (ns-interns `clojure.core)) ; only 621 functions to learn :-)
    621
    user=>
  • ;; See also http://clojure.org/namespaces for information on namespaces in Clojure and how to inspect and manipulate them
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:3734 top

(defn ns-interns
  "Returns a map of the intern mappings for the namespace."
  {:added "1.0"
   :static true}
  [ns]
  (let [ns (the-ns ns)]
    (filter-key val (fn [^clojure.lang.Var v] (and (instance? clojure.lang.Var v)
                                 (= ns (.ns v))))
                (ns-map ns))))
Vars in clojure.core/ns-interns:
Used in 0 other vars

Comments top

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