Lesson 9. documentation, auto completion and history
In this lesson, we will explore more features of the Klipse REPL. Those features make your Clojure coding experience more productive.
After reading this lesson, you will be able to:
- display the documentation of forms
- auto complete your code
- navigate the history of previously evaluated forms
9.1 Documentation
So far, we have encountered the following forms:
- arithmetic expressions: +, *, - and /
- arithmetic comparisons: >, <, >=, <= and =
- logic operations: and, or and not
And you will encounter much more through your Clojure journey.
It will take some time until you remember the behaviour of each and every Clojure form and even after you become a Clojure master, you might not remember the exact behaviour of a specific form in a specific case. The REPL is aware of this need: it provides a very simple way to display the documentation of any Clojure form. The REPL provides a form named doc that displays the documentation of any Clojure form. The doc form receives as a single argument the name of a the Clojure form.
For instance, let’s see the documentation of the not form in the REPL:
user=> (doc not) ------------------------- #A clojure.core/not #B ([x]) #C Returns true if x is logical false, false otherwise. #D ------------------------- #E Online doc: https://clojuredocs.org/clojure.core/not #F nil #G