for loop not working in less css mixin
<p>I have noticed that a piece of Less I thought was working as expected is not actually generating all the styles I need - my for loop is not working.</p>

<p>The less in question is:</p>

<pre><code>.for(@list, @code) {
    &amp; {
        .loop(@i:1) when (@i =&lt; length(@list)) {
            @value: extract(@list, @i);

            @code();

            .loop(@i + 1);
        }

        .loop();
    }
}

.role-variants(@variants, @props){
    .for(@variants, {
      .security_class_@{value} {
        @props();
      }
    });
}

@admin-roles: admin, admin_manager, admin_user, admin_manager_user;

html{
    body{
        &amp;.admin{
            .role-variants(@admin-roles, {display: block;});
        }
    }
}
</code></pre>

<p>on <a href="http://less2css.org/" rel="nofollow">http://less2css.org/</a> this compiles correctly, generating the classes I expect.</p>

<p>When I compile locally, I only get the following class:</p>

<pre><code>html body.admin .security_class_admin {
    display: block
}
</code></pre>

<p>My for loop is not working locally, though it seems to be valid and working using the less compiler. Any ideas on how I can modify it to work locally, or perhaps I need to update my environment to a specific version, though it seems to be up to date.</p>

<p>Thanks again for your help.</p>

<p>Jamie</p>