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

find-doc

clojure.core

  • (find-doc re-string-or-pattern)
Prints documentation for any var whose documentation or name
contains a match for re-string-or-pattern

1 Example top

  • ;; Finds everything with struct-map in the name or description. In this case, it finds
    ;; two things:  clojure.core/struct-map and clojure.xml/parse.
    
    user=> (find-doc "struct-map")
    -------------------------
    clojure.core/struct-map
    ([s & inits])
      Returns a new structmap instance with the keys of the...
    nil
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:3837 top

(defn find-doc
  "Prints documentation for any var whose documentation or name
 contains a match for re-string-or-pattern"
  {:added "1.0"}
  [re-string-or-pattern]
    (let [re  (re-pattern re-string-or-pattern)]
      (doseq [ns (all-ns)
              v (sort-by (comp :name meta) (vals (ns-interns ns)))
              :when (and (:doc (meta v))
                         (or (re-find (re-matcher re (:doc (meta v))))
                             (re-find (re-matcher re (str (:name (meta v)))))))]
               (print-doc v))))
Vars in clojure.core/find-doc: defn doseq let print-doc
Used in 0 other vars

Comments top

No comments for find-doc. Log in to add a comment.