title: Updating object properties in twig
body: <p>Is there a way to update an object's property in twig?</p>
  
  <p>An object like the following is passed to twig:</p>
  
  <pre><code>object
     property1
     property2
  </code></pre>
  
  <p>I would like to update property1 like this:</p>
  
  <pre><code>{% set object.property1 = 'somenewvalue' %}
  </code></pre>
  
  <p>The above code does not work, but is it possible to do something like this in twig? If not, is there a way to write an extension or macro to do this?</p>