Clojure: Doc Lookup, Find Function

By Xah Lee. Date:

This page shows you how to use Clojure help system for reading documentation offline, and how to find functions.

Show Inline Doc of a Function

To get the inline doc of a function, start REPL and call the doc function.

(doc list) ; show doc of the symbol “list”

Here's a sample output:

user=> (doc list)
-------------------------
clojure.core/list
([& items])
  Creates a new list containing the items.
nil
user=>

clojure.repl/doc

Finding Function

To list all functions that contains a string/regex in their names, use “apropos”.

◆ clojure
Clojure 1.8.0
user=> (apropos "list")
(clojure.core/list clojure.core/list* clojure.core/list?)
user=>

clojure.repl/apropos

To search a string/regex in all inline doc, use find-doc.

(find-doc "list")

clojure.repl/find-doc

Using Emacs CIDER

If you are using emacs CIDER, you can call cider-docCtrl+c Ctrl+d Ctrl+d】 to lookup doc of the fuction under cursor.

There are many functions for looking up doc or finding function:

〔►see Emacs: Clojure CIDER Tutorial

Download Clojure Cheatsheet Offline

http://clojure.org/api/cheatsheet