If I understand your question correctly, you want to manipulate a deeply 
nested tree-like data structure, right? If that's correct, then perhaps a 
combination of clojure.zip and multimethods will suit your needs. Zippers 
provide a facility to transform (possibly) deeply nested immutable data 
structures in a way that "feels" like you are editing the data structure in 
place when you are actually not. To only manipulate the nodes that match a 
certain pattern, I would suggest writing a multimethod that allows you to 
identify a certain "class" of nodes that necessitate a type of 
modification. That way as you learn more about how your code needs to be 
structured to fit the needs of your data you can add new multimethod 
implementations to fit your needs. The default implementation should 
probably just move to the next loc in the zipper without modifying 
anything. 

On Thursday, July 3, 2014 12:12:35 PM UTC-4, Brian Craft wrote:
>
> What clojure tools should I be considering for doing syntax tree 
> manipulations? In general, I'm recursively matching patterns in subtrees 
> and rewriting them. The patterns are usually more complex than, say, 
> core.match patterns (e.g. match subtree having vector that contains term, 
> and split the term out of the vector and put in its own subtree).
>
>

-- 
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/d/optout.

Reply via email to