(Dang reply-to)

> I wonder if it might be better to have a new construct instead of FOREACH?

I have no general problem with this, but I think I'd prefer to change the
ELSE rather than the FOREACH.  Perhaps FORELSE?  Adding an ELSE to and IF
doesn't require that you change the IF...Are we saying you would have to
change the FOREACH?

>   [% LOOP item = list %]
>      <tr><td>[% item %]</td></tr>
>   [% BEFORE %]
>      <table>
>   [% AFTER %]
>      </table>
>   [% EMPTY %]
>      There are no items in the list.
>   [% END %]

I'm not fond of the BEFORE coming _after_ what it modifies.  Perhaps:

[% LOOP item = list %]
[% BEFORE %]
  <table>
[% DURING %]
  <TR><TD>[% item %] </TD></TR>
[% AFTER %]
  </table>
[% EMPTY %]
  No items
[% END %]

But on reflection, we're creating a big construction for an otherwise
simple common need.  Or maybe this is just illustrating the biggest form,
and the simple LOOP/EMPTY/END does what I was talking about.

I'm out of hands, anyone else what to take a stab at it?




Reply via email to