[ZPT] Re: Mini proposal: repeat-define and repeat-condition

Fernando Martins fmartins@hetnet.nl
Fri, 24 Jan 2003 00:59:40 +0100


Evan Simpson wrote:
> Jamie Heilman wrote:
> > Fernando Martins wrote:
> >>argument ::= variable_name expression [; condition] [;define-var]*
> >
> > These are the most sane suggestions to date.  They don't break
> > backwards compatability, and they don't needlessly bloat the TAL
> > operation set.  I don't have any arguments against this approach, does
> > anyone?
>
> Sorry, yes.  To do this properly and consistently, each of the
> expressions would need to do ';'-escaping in the same fashion as
> tal:define and tal:attributes.  This, in turn, would break templates
> that currently have ';' in their tal:repeat expressions.  While
> unlikely, this isn't impossible.
>

Hmm, from a quick look at the TALES and Python references it appears to me
that ';' can only appear inside string expressions. It would be a simple
matter of ignoring ';' while parsing strings.

Another option would be to create an alternative to 'tal:repeat', like
'tal:loop' to support the extra condition and variable definition.

Regards,
Fernando