As far as I know, there is no support for any kind of loops in ParserFunctions (or elsewhere in MediaWiki). See e.g. the thread around http://permalink.gmane.org/gmane.org.wikimedia.foundation/13877
You can do for loops with a series of ifs, for instance:
<includeonly>{{#if:{{{2|}}}|{{{{{1}}}|{{{2}}}}}}}{{#if:{{{3|}}}|{{{delim |}}}{{{{{1}}}|{{{3}}}}}}}{{#if:{{{4|}}}|{{{delim|}}}{{{{{1}}}|{{{4}}}}}} }{{#if:{{{5|}}}|{{{delim|}}}{{{{{1}}}|{{{5}}}}}}}{{#if:{{{6|}}}|{{{delim |}}}{{{{{1}}}|{{{6}}}}}}} {{#if:{{{7|}}}|{{{delim|}}}{{{{{1}}}|{{{7}}}}}}}{{#if:{{{8|}}}|{{{delim| }}}{{{{{1}}}|{{{8}}}}}}}{{#if:{{{9|}}}|{{{delim|}}}{{{{{1}}}|{{{9}}}}}}} {{#if:{{{10|}}}|{{{delim|}}}{{{{{1}}}|{{{10}}}}}}}{{#if:{{{11|}}}|{{{del im|}}}{{{{{1}}}|{{{11}}}}}}}</includeonly>
This can be called to run a template for each item (up to 10?):
{{Foreach|SomeTemplateToBeCalled|delim=<br/>|a|b|c|d|e|etc...}}
And just for good measure, here is one that will use run a template that takes two arguments (up to 10 total as well?):
<includeonly>{{#if:{{{2|}}}|{{{{{1}}}|{{{2}}}|{{{3}}}}}}}{{#if:{{{4|}}}| {{{delim|}}}{{{{{1}}}|{{{4}}}|{{{5}}}}}}}{{#if:{{{6|}}}|{{{delim|}}}{{{{ {1}}}|{{{6}}}|{{{7}}}}}}}{{#if:{{{8|}}}|{{{delim|}}}{{{{{1}}}|{{{8}}}|{{ {9}}}}}}}{{#if:{{{10|}}}|{{{delim|}}}{{{{{1}}}|{{{10}}}|{{{11}}}}}}}{{#i f:{{{12|}}}|{{{delim|}}}{{{{{1}}}|{{{12}}}|{{{13}}}}}}}{{#if:{{{14|}}}|{ {{delim|}}}{{{{{1}}}|{{{14}}}|{{{15}}}}}}}{{#if:{{{16|}}}|{{{delim|}}}{{ {{{1}}}|{{{16}}}|{{{17}}}}}}}{{#if:{{{18|}}}|{{{delim|}}}{{{{{1}}}|{{{18 }}}|{{{19}}}}}}}{{#if:{{{20|}}}|{{{delim|}}}{{{{{1}}}|{{{20}}}|{{{21}}}} }}}{{#if:{{{22|}}}|{{{delim|}}}{{{{{1}}}|{{{22}}}|{{{23}}}}}}}</includeo nly>
Used like:
{{Foreach2|SomeTemplateToBeCalled|delim=<br/>|a|a2|b|b2|c|c2|etc|etc2... }}
And, yes, these templates are extremely ugly. ;)
V/r,
Ryan Lane