1.3.0 permalink Arrow_down_16x16

find-doc

clojure.repl

  • (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

  • user=> (find-doc "data structure")
    
    -------------------------
    clojure.core/eval
    ([form])
      Evaluates the form data structure (not text!) and returns the result.
    -------------------------
    clojure.core/ifn?
    ([x])
      Returns true if x implements IFn. Note that many data structures
      (e.g. sets and maps) implement IFn
    
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/repl.clj:104 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)
          ms (concat (mapcat #(sort-by :name (map meta (vals (ns-interns %))))
                             (all-ns))
                     (map namespace-doc (all-ns))
                     (map special-doc (keys special-doc-map)))]
      (doseq [m ms
              :when (and (:doc m)
                         (or (re-find (re-matcher re (:doc m)))
                             (re-find (re-matcher re (str (:name m))))))]
               (print-doc m))))
Vars in clojure.repl/find-doc:
Used in 0 other vars

Comments top

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