Welcome! Please see the About page for a little more info on how this works.

0 votes
in REPL by

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

3 Answers

0 votes

Comment made by: alexmiller

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.

0 votes

Comment made by: terje@andante.no

  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:

0 votes
Reference: https://clojure.atlassian.net/browse/CLJ-1836 (reported by terje@andante.no)