Hi,

Speaking of program analysis tools (I was, in another thread), has 
anybody written anything along these lines for Clojure?

I appreciate the (doc) and (find-doc) built-ins and use them quite a 
lot, but they don't help when it comes to analyzing existing Clojure
source code.

As a rank amateur at Clojure (and someone who hasn't done much Lisp 
programming for quite a few years, now), I find myself looking to the 
Clojure code of others, especially that comprising the Clojure language 
itself as well as the Clojure-Contrib library, for examples of how to do 
things or how existing things are done.

However, grep is a meager tool for finding things (even all the spiffy
options in Gnu grep). One step up would be a tags-file generator.

So... As I'm writing this, it occurs to me that the compiler attaches 
source location information (file name and line number) as metadata to 
any Var it creates (I think that's the proper locus of the attachment), 
so one element of simple cross-reference tool is already there:

user=> (meta (var doc))
{:line 2559,
 :doc "Prints documentation for a var or special form given its name",
 :file "core.clj",
 :arglists ([name]),
 :macro true,
 :name doc, :ns #<Namespace clojure.core>}

user=> (meta (var meta))
{:line 147,
 :doc "Returns the metadata of obj, returns nil if there is no metadata.",
 :file "core.clj",
 :arglists ([obj]),
 :name meta,
 :ns #<Namespace clojure.core>}


Hmm... I think I'll try to write a tags-file generator... I seem to
recall seeing some name-space oriented introspection built-ins
that should be suitable for driving the process.


Randall Schulz

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to