 cachedVars = {}
 
 astFunctions =
+  
+  execute: (ast) =>
+    for vs in ast.vars
+      @_execute vs
+    for cs in ast.constraints
+      @_execute cs
+  
+  _execute: (ast) =>
+    for node in ast
+      func = @[node[0]]
+      for sub, i in node[1...node.length]
+        if sub instanceof Array # then recurse
+          node[i] = @_execute sub
+      return func.apply @, node[1...a.length]
+  
   
   var: (id, prop, context) ->
     if cachedVars[id]

  gt: (e1,e2,s,w) =>    
    return new c.Inequality e1, c.GEQ, e2, @strength(s), w

onmessage = (constraints) ->
  # TODO: Include Cassowary, solve
  if c.Equation isnt null
    postMessage(
      a: 7
      b: 5

  get: (id) ->
    if cachedVars[id]
      return cachedVars[id]
    throw new Error("AST method 'get' couldn't find var with id: #{id}")
      
  plus: (e1,e2) ->
    return c.plus e2, e2 
  
