On Tue, Feb 21, 2012 at 9:21 AM, Cedric Greevey <cgree...@gmail.com> wrote: > On Tue, Feb 21, 2012 at 8:51 AM, Aaron Cohen <aa...@assonance.org> wrote: >> 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}]?
Yes, any descendant. It's almost irrelevant what gets put into the vector, in the example I extracted it's {:value (:form node)}, in the actual code I do more processing to also attach a type. >> 2) Any nodes that are a child of an :op :let node, > > Direct child, or any descendant? 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? Nope that's fine. The parent-most one should not have :unbox true, the second should (as well as all descendants for both). -- 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