Programming Clojure, Fourth Edition: Calling doc on function declared in different namespace.

Title: Programming Clojure, Fourth Edition: Calling doc on function declared in different namespace (page 25)

On page 25 of the book, when declaring the greeting function, it is in src/examples/exploring.clj

a newcomer should be using the code of the book that includes this code under examples.exploring namespace.

So, calling doc on it will fail since clojure.repl/doc is not aliased in the namespace, or if run from the user namespace it won’t print anything since greetings is not a symbol defined in the user namespace.

I’d suggest to either be explicit about this, or add the namespace when calling doc.

(doc examples.exploring/greeting)
-------------------------
examples.exploring/greeting
([] [username])
  Returns a greeting of the form 'Hello, username.'
   Default username is 'world'.
=> nil
(doc greeting)
=> nil