>> So, I really would like to hook into the doc function so that I can
>> return a documentation string pulled directly from the underlying Java
>> object; I already have a function for doing this, but do not know how to
>> get the native Clojure facilities to call this, rather than just take
>> the documentation directly from the metadata. 


Brian Marick <mar...@exampler.com> writes:
> Could you wrap clojure.repl/print-doc using something like Robert Hooke?
> https://github.com/technomancy/robert-hooke


Hugo Duncan <duncan.h...@gmail.com> writes:
> Could you initialise the var metadata using the docstring pulled from
> the java object. You would probably need your macros to generate
> alter-var-root forms to add the metadata.


So, in the end, I did a combination of the two. I've used Robert Hooke
to hook the print-doc function -- hooking doc directly doesn't work as
it's a macro; so even running macroexpand forces the hook, which didn't
seem ideal.

My hook then places the docstring onto the var before. Not ideal, as
things like apropos or find-doc are still not going to work; but then
these are limited for larger namespaces. I already have 50,000 symbols
in one namespace, and string matching is just not going to cut it. 

Thanks anyway for the help. Much appreciated. 

Phil

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to