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

Shane Hathaway shane@zope.com
Tue, 21 Jan 2003 21:16:10 -0500


Evan Simpson wrote:

>  > > I had propsed changing the order of operations from "define, 
> condition,
>  > > repeat, etc." to "repeat, define, condition, etc.", and using a
>  > > processing instruction in a similar fashion to Python's "import from
>  > > __future__".

+1 from me.  It's better than my proposal.

Dieter Maurer wrote:

> Making "tal:define" local with respect to the iteration
> would break lots of our existing page templates.
> I would not be happy when I had to add some processing instruction
> in all of them.
>
> For "tal:condition", I see few problems.
>
>
> Care must be taken when templates with and without
> the processing instruction are combined (via "metal:use-macro").
> Execution order may need to be switched for macro body and
> back again for slot.

I imagine that the choice would be made at compile time, so that 
templates with the processing instruction would produce different byte 
code than templates without the PI.

One minor concern is that old page template parsers will see the new 
templates and blissfully proceed to parse them incorrectly.  I think we 
need a way to specify the required version of TAL in templates.

Shane