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.
Patch: doc-fn.patch