liveBook · Manning

Find-doc

As explained in Clojure: The Essential Reference

find-doc is a Clojure REPL function that searches available documentation strings using a regular-expression pattern.

find-doc searches available Clojure documentation strings with a regular-expression pattern. Use it when you know part of a name or a use case rather than an exact symbol; use doc when the symbol is known. section 22.3

Search names beginning with to-

(find-doc "^to-") ;; ------------------------- ;; clojure.core/to-array ;; Returns an array of Objects containing the contents of coll. ;; ------------------------- ;; clojure.core/to-array-2d ;; Returns a potentially-ragged 2-dimensional array of Objects. The anchor restricts matches to documentation strings beginning with "to-". Without the anchor, a generic "to-" pattern can produce several pages because it may match anywhere in a name or documentation string. section 22.3

Choose the REPL search according to what you already know:

  • Use doc for the documentation associated with a specific symbol. section 22.3
  • Use apropos when you want names containing a pattern, without searching documentation text. section 22.3

How Clojure: The Essential Reference covers it

How deep it goes
Defines regular-expression matching and pattern scope, but stops short of implementation internals.
Examples
Demonstrates an anchored search for functions and macros whose documentation begins with "to-".
What it assumes
Assumes REPL familiarity and basic regular-expression patterns while contrasting exact-symbol lookup with name search.
What you can do after
Evaluate documentation searches with regular expressions and narrow overly broad results using anchors or apropos.
How it connects
Connects regular expressions with doc and apropos as complementary documentation-search tools.

This explainer was generated by Manning's knowledge graph from the text of Clojure: The Essential Reference. The section links point to the parts of the book it draws on.