[ZPT] [Weakness] "tal:repeat" not yet right

Richard Jones richard@bizarsoftware.com.au
Thu, 27 Sep 2001 10:09:04 +1000


On Thursday 27 September 2001 09:45, Richard Jones wrote:
> On Thursday 27 September 2001 07:40, Evan Simpson wrote:
> > Dieter Maurer wrote:
> >  > 1. The "tal:repeat" has two different relevant contexts:
> >
> > [snip]
> >
> >  > Currently, we have "tal:define" for the complete loop and
> >  > "tal:condition" for each iteration.
> >
> > Yes, in retrospect we should probably have made "tal:repeat" the first
> > statement to be executed, so that all other statements on the same tag
> > are in the iteration context.  Then it's clear that you need to use an
> > enclosing tag for loop-level setup.
>
> Even though the situation isn't perfect, we're getting along with using it
> fine. The contexts of the "define" and "condition" commands may be
> different, but we feel they've fallen on the right "side" of the
> loop/element context for everyday use. My gut says that if the context
> split was "fixed" then we'd have more "context-fixing" tags introduced.

Actually, I take this back - I've talked to our design people, and it looks 
like this is what they've been doing _anyway_. That is, there's almost always 
a:

  <div tal:define="loop_list some/expression">
    <span tal:repeat="item loop_list"/>
  </div>

or similar. I'm a little out of touch with their latest work, it seems.



> > I'm very reluctant to change the order of operations this late in the
> > game, though, and having two sorts of 'define' and 'condition' statement
> > seems very awkward to me.
>
> Yes, that would break things, badly.

It would appear this was overstated, and I apologise. We will have a problem 
with anyone we've shipped our product to - we don't control the PT code, and 
there's a chance it'll break. I think we can cover ourselves with enough 
warning notices with the upgrade though.

Again, sorry to have misled. I get a little reactionary when anyone proposes 
a incompatible change to ZPT :)


      Richard