Expose clojure.repl/doc as a function call
Restructure the printing function clojure.repl/doc so that it calls a fuction clojure.repl/doc-fn for its data - in the same way as dir calls dir-fn. Make doc-fn public so that it can be called directly and allow developers to parse and display the data as needed.
Use case: I am making a namespace inspector (using JavaFX) (somewhat like the Swing-based tree-inspector in Clojure), and when getting a function, I would like to display the same meta-information as "doc" prints in the REPL - including the special forms data coded in a private var/map in Clojure.
1. Agreement signed.
2. Tests added.
(That was useful! I had to fix a couple of things.)
3. Patch created as per instructions and attached:
A few comments:
1) Patch authors must sign the contributor's agreement, see http://clojure.org/contributing
2) The patch is not in the correct format - see http://dev.clojure.org/display/community/Developing+Patches for more info.
3) Patch should include a test for the new doc-fn.