>Getting back to the immediate question, determining "who calls whom" >can be a problem in dynamic languages such as Clojure and Ruby. So, >the programmer may need to provide hints. Alternatively, it may be >possible to get this information by monitoring program operation in >a testing or limited production environment.
In my experience, there are 2 cases. Either the call is explicit or the call is constructed (e.g. funcall). In the explicit case, it is easy to write a program to read code. Code walkers exist for common lisp. I'm not sure if there is a code walker for Clojure (does one exist? If not, is this a GSOC?) Code walkers can macro expand code to find embedded calls. In the constructed case the architecture needs documentation. I'm advocating literate programming because this is obviously the way to do that. The cross-references come for free. Axiom (common lisp) uses a parser driven by alist on symbols (maps, in Clojure speak). Thus it is not obvious where a parser function is called. Indeed, it is not obvious that it is ever called as the symbol name for the parser function is constructed at the call site. Using grep on the source code will find nothing. The developer would assume it is dead code since there is no reference to it. Documenting the constructed case requires hand labor. Augmenting the document index with \calls macros adds information that the author knows and a developer needs to maintain the code at little cost of time and effort. Actually I think Clojure adds a third case because it uses Java libraries. This requires an explanation as well as explicit markup (hand labor) to provide the information a developer needs. Thus, 2 of the 3 cases involve hand labor to add valuable information a developer needs to maintain the code. There ought to be a way to write this down. Indeed, it could be written down in a form that the program analysis suite can use as "advice". Tim Daly -- -- 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.