title: Traversing, iterating, visiting trees in Clojure
body: <p>Say I have a Clojure tree as defined below</p>
  
  <pre><code>(def eval-logic
    '(:OR
       (:METHOD "methodName1" ["a1" "a2" "a3"])
       (:METHOD "methodName2" ["b1" "b2" "b3"])
       :AND
         (:METHOD "methodName3" [])
         (:METHOD "methodName4" ["d1"])
       ))
  </code></pre>
  
  <p>I.e. the tree represents a boolean expression where nodes like :OR and :AND represent boolean operators and the leaves of the tree are method calls. The tree is not to be evaluated, only to be traversed to generate code that performs the actual evaluation at runtime.
  How should I go about traversing the tree, visiting different kinds of nodes, asking for a node's father, children, siblings, etc.? Are there any pointers or libraries to look into ?</p>
  
  <p>The tree cannot be too deeply nested so tail-recursion is not a concern. Feel free to propose some other data-structure that might perhaps be more amenable to traversing.</p>
  
  <p><em>I am particularly interested for depth-first traversals as this is the order that code will have to generated to ensure functions are defined before they are used. Also, the tree is given and won't change so I'm not interested in things like adding or removing children</em></p>