Hello, You can take a look at how clojuredev obtains information to produce the namespace browser : the gathering part is written in clojure, the usage part in java (currently, we'll rewrite this all in clojure eventually).
The evaluation is done inside a running REPL, sent back via a socket to clojuredev. So everything has been translated to strings or keywords or class clojure structure before sending over TCP/IP. here a snapshot of the information available (2d and 3rd images) : http://code.google.com/p/clojure-dev/wiki/ScreenShots here direct access to the source code of the server part : http://code.google.com/p/clojure-dev/source/browse/clojuredev/trunk/src/clojuredev/debug/serverrepl.clj (still pre-lazyseq stuff) here direct access to the part that calls the server part : http://code.google.com/p/clojure-dev/source/browse/clojuredev/trunk/src/clojuredev/outline/NamespaceBrowser.java#403 and http://code.google.com/p/clojure-dev/source/browse/clojuredev/trunk/src/clojuredev/debug/ClojureClient.java HTH, -- Laurent 2009/3/1 David <david.ra...@gmail.com> > > Every now and again I try to get serious about learning Clojure and > every time I quit due to its documentation. I find it confusing. > Nothing seems to be where it should be, there are almost no examples > etc. So, every time I end up writing (in Java, I might add) a > documentation browser with index, full-text search support, bookmarks > (something similar to Eclipses help system or kchmviewer) and maybe a > possibility of adding custom examples to meta :doc with aspiration of > building a personal tutorial as I go along. > > I can't seem to find a way of obtaining that information from Clojures > runtime in a "standard" manner, however. I tried tackling the > 'problem' with evaluating a (map meta (reduce concat (map vals (map ns- > publics (all-ns))))) and then parsing the result using Clojures java > classes. I can do that without major problems. But I'm tired of doing > it every time when some (sub)results type gets changed (the last one > was from LazyCons to LazySeq) and I naively update everything from the > SVN. > > Is there any guarantee with regard to the internal structure of > evaluation results (speaking in Java terms)? If not, is there > something planed to that effect for official release(s)? > > Alternatively, what's the best (quickest, most robust, ...) way of > obtaining Clojures runtime info in a manner similar to this: > > Map<String, interns> > // keys == distinct namespace names > > interns: Map<String, meta> > // keys == distinct intern or public names > > meta: Map<String, String> (or Map<String, List<String>> for the sake > of arguments ;-) ) > // keys == meta names > > in a sentence: something that could be parsed from within Java using > java.lang.String and Java collection classes? > > Regards, > David > > > --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---