title: how to change parameter variable value in a recursive macro?
body: <p>I want to show a number sequence in black color, and show nested sequence number in red. Here is my marco code:</p>
  
  <pre><code>&lt;#macro test datas isNested&gt;
      &lt;#list datas as d&gt;
      &lt;#if d?is_enumerable&gt;
          &lt;#local isNested = true&gt;
          &lt;#if isNested&gt;
              &lt;#-- become red if it is nested --&gt;
              Hi, I am going to be red!
                              &lt;#-- some business code --&gt;
          &lt;/#if&gt;
          &lt;@test d isNested/&gt;
      &lt;#else&gt;
          &lt;#if isNested&gt;
              &lt;span style="color:red;"&gt;${d}&lt;/span&gt;
          &lt;#else&gt;
              ${d}
          &lt;/#if&gt;
      &lt;/#if&gt;
  &lt;/#list&gt;
  &lt;/#macro&gt;
  </code></pre>
  
  <p>call it like this: <pre>&lt;@test [1,2,3,[4,5],6,7] false/></pre>
  I want it to be: <pre>1 2 3 Hi, I am going to be red! 4 5 6 7</pre>
  only 4 and 5 show in red.<br/>
  But now I get this:</p>
  
  <pre>1 2 3 Hi, I am going to be red! 4 5 6 7</pre>
  
  <p>all of 4 5 6 7 are show in red.</p>
  
  <p>I think this line of code <code>&lt;#local isNested = true&gt;</code> play the trick. I also try to use <code>assign</code>, <code>global</code>, all of 1 2 3 4 5 6 7 are black.</p>
  
  <p>so how should I do?
  Thx in advance.</p>
  
  <p><strong>PS</strong>:<br/>
      I don't know how to make code show in red in stackoverflow, if any one knows plz helps me to edit my code.</p>