[ZPT] Re: tal:repeat and variables

Evan Simpson evan@4-am.com
Wed, 12 Feb 2003 16:19:14 -0600


Fernando Martins wrote:
> "Note that first and last are intended for use with sorted sequences. They
> try to divide the sequence into group of items with the same value...."
> 
> Does this imply that each time first (or last) is called, the sequence is
> grouped?? What happens if I call first('name')?

If this is the first repetition, it returns true.  Otherwise, if the 
value of 'name' is different in the current and prior repetitions, it 
returns true.  Otherwise, it returns false.

This is why it needs a sorted sequence -- it only compares the current 
and prior values, which only works if the values are already sorted.

> BTW, do you think it's worth to suggest the implementation of repeat/vars?

That would probably be better handled with ZTUtils.Batch and a Script.

Cheers,

Evan @ 4-am