title: Apache Velocity macro default parameter values
body: <p>I want to update a macro that's shared between a number of different .vtl files to include a new parameter. However, I only want to change the call in one of my .vtl files and leave the others unchanged. So, I essentially want to add an optional parameter, or a parameter with a default value if no parameter is provided.</p>
  
  <p>The documentation (<a href="http://velocity.apache.org/engine/devel/vtl-reference-guide.html" rel="noreferrer">here</a>) mentions optional default values in the "#macro" section, but after a couple hours of fidgeting with them I can't for the life of me figure out what the proper syntax is.</p>
  
  <p>So I want to take the existing macro: </p>
  
  <pre><code>    #macro( my_macro ) 
          oldValue
      #end
  </code></pre>
  
  <p>And turn it into a macro like: </p>
  
  <pre><code>    #macro( my_macro $param="oldValue" ) 
          $param
      #end
  </code></pre>
  
  <p>Where I could call it properly with either of these two calls and get the specified outputs: </p>
  
  <pre><code>    #my_macro()            =&gt; oldValue
      #my_macro("newValue")  =&gt; newValue
  </code></pre>
  
  <p>I've tried every permutation of what's specified in the documentation, but can't find anything that works. Does anyone know the proper syntax? Is there possibly a property that I'm missing?</p>
  
  <p>I'm using Velocity 1.7 and VelocityTools 2.0. I'm also using the setting
  <code>velocimacro.arguments.strict=true</code>
  if that matters. However, I can't easily change this property without a bunch of updating / retesting.</p>