David J.
David J.

Reputation: 32715

Missing doc in non-user namespaces in Clojure 1.5

What should I do to get doc available again?

brew install --devel leiningen
lein new app yeehaw
cd yeehaw
; edit project.clj and replace "1.4.0" with 1.5.0-RC1"
lein repl
yeehaw.core=> (doc map)
CompilerException java.lang.RuntimeException: Unable to resolve symbol: doc
in this context, compiling:(NO_SOURCE_PATH:1:1) 

This change comes from CLJ-1085 and this associated source.

Note that doc and the usual REPL functionality is still available in the user namespace, but it would be nice to have it at my fingertips in my app's namespace, at least while in the REPL.

Upvotes: 10

Views: 1229

Answers (2)

mobyte
mobyte

Reputation: 3752

Get doc into current namespace:

(clojure.core/use '[clojure.repl :only (doc)])

And after that try doc again.

Upvotes: 12

David J.
David J.

Reputation: 32715

Thanks to help from clojure IRC, here are some options:

  • use clojure.repl/doc instead of doc
  • use (apply require clojure.main/repl-requires) to bring doc and other REPL functionality into a new namespace.

Upvotes: 9

Related Questions