title: How can I evaluate algebraic expressions defined in YAML?
body: <p>I have the following two separate YAML files.</p>
  
  <ul>
  <li><code>val.yaml</code>: variables are defined here</li>
  <li><code>expr.yaml</code>: expressions are defined here</li>
  </ul>
  
  <p><strong><code>val.yaml</code></strong></p>
  
  <pre><code>x: 2
  y: 3
  z: 5
  </code></pre>
  
  <p><strong><code>expr.yaml</code></strong></p>
  
  <pre><code>result: (x + y) * z
  </code></pre>
  
  <p><strong><code>parse.py</code></strong></p>
  
  <pre><code>import yaml
  
  with open('val.yaml', 'r') as stream:
      val = yaml.load(stream)
  
  with open('expr.yaml', 'r') as stream:
      expr = yaml.load(stream)
  
  ....
  
  # this should be (2 + 3) * 5 = 25
  print expr['result']
  </code></pre>
  
  <p>How can I evaluate expressions defined in <code>expr.yaml</code> by referencing variables defined in <code>val.yaml</code>?</p>