* David Green <[EMAIL PROTECTED]> [2008-12-03 22:00]:
> FIRST{} can do something on only the first iteration through
> the loop, but there's no NOT-FIRST block to do something on the
> second and subsequent iterations. Is there an elegant way to do
> something on all but the first loop?
Not with a closure trait and without a flag, which I guess does
not count as elegant.
In Template Toolkit this is nice insofar as that the loop
iterator is available as an object in a variable, so you can say
IF loop.first ; ... ; END ;
but equally
IF NOT loop.first ; ... ; END ;
and similarly you can say
IF NOT loop.last ; ... ; END ;
to do something on all iterations but the ultimate.
Regards,
--
Aristotle Pagaltzis // <http://plasmasturm.org/>