On Tue, Feb 21, 2012 at 8:51 AM, Aaron Cohen <aa...@assonance.org> wrote: > Hi all, > > After a good deal of effort, I managed to beat the following code > into something functional, but it's getting kind of big, unwieldy and > hard to follow. > > I'd appreciate if anyone could take a look and give me some pointers. > > First, it will probably be easier for me to describe what is > supposed to happen. > > Given an ast, which can be approximated as: {:op :fn, :children [{:op > :let, :children [{:op :constant, :form 1}]}]} > > I would like to process the ast such that: > 1) Any nodes that are of :op :fn, get an entry added named > ":constants" which contains a vector of all the constants found in any > of their children
This is transitive to all descendants? So in the above case the top node should get a :constants key? And what should be in that, [{:form 1}]? > 2) Any nodes that are a child of an :op :let node, Direct child, or any descendant? > get an additonal element ":unbox true". In particular, the let node must not > get > :unbox true, but may get :unbox nil or false if it's easier. What if an :op :let node is a child of another :op :let? Or is that not supposed to ever happen? -- 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