title: Freemarker assign list length to local variable
body: <p>The following freemarker code causes an exception</p>
  
  <pre><code>&lt;#assign i= it.getList().size()&gt;
  &lt;#list it.getList() as elem&gt;
      &lt;#if i==1&gt;
      &lt;li&gt;${elem.name}&lt;/li&gt;
      &lt;#else&gt;
      &lt;li class="marked"&gt;${elem.name}&lt;/li&gt;
      &lt;/#if&gt;
      &lt;#assign i = i-1&gt;
  &lt;/#list&gt;
  </code></pre>
  
  <p>The following exception is thrown:</p>
  
  <blockquote>
    <p>Expected hash. it.getList() evaluated instead to freemarker.template.SimpleSequence</p>
  </blockquote>
  
  <p>Anyone knows why? How can i assign the length of the list to my variable <code>i</code>?</p>