Is there a tt2 idiom for "commafying" a list of items?

I'm generating a link of items with the code like:

[% FOREACH item = list %]
  item.NAME,
[% END %]

which leaves me with a trailing comma.

in a template language i was using, they had a construct called SEPARATOR
so you had:

[% REPEAT item = list %]
  item.NAME
  [% SEPARATOR %],[% END SEPARATOR %]
[% END REPEAT %]

so that the results of the loop were joined with a comma.

now i can think of a number of ways to solve this ( IF loop.index <
loop.max), but i'm hoping there is something clean, and simple.

thanks for your help
kellan

--
"we reject kings, presidents and voting. we believe in
rough consensus and running code." [david clark (MIT)]

[EMAIL PROTECTED]




Reply via email to