• (apropos str-or-pattern)
Given a regular expression or stringable thing, return a seq of
all definitions in all currently-loaded namespaces that match the
str-or-pattern.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/repl_utils.clj:133 top

(defn apropos
  "Given a regular expression or stringable thing, return a seq of 
all definitions in all currently-loaded namespaces that match the
str-or-pattern."
  {:deprecated "1.2"}
  [str-or-pattern]
  (let [matches? (if (instance? java.util.regex.Pattern str-or-pattern)
                   #(re-find str-or-pattern (str %))
                   #(s/substring? (str str-or-pattern) (str %)))]
    (mapcat (fn [ns]
              (filter matches? (keys (ns-publics ns))))
            (all-ns))))
Vars in clojure.contrib.repl-utils/apropos: all-ns defn filter fn keys let mapcat ns ns-publics
Used in 1 other vars apropos

Comments top

No comments for apropos. Log in to add a comment.