[ZPT] Proposal: Change order, redocument and provide "finder" script

Troy Farrell troy@entheossoft.com
Wed, 22 Jan 2003 09:46:17 -0600


Overview (someone stop me if this is wrong)

The problem was laid out by Shane H:
http://lists.zope.org/pipermail/zpt/2003-January/004210.html

The current TAL order of operations:

1. define
2. condition
3. repeat
4. content or replace
5. attributes
6. omit-tag

The proposed changes deal with situations where it is desirable to have 
the tal:define and tal:condition statements executed for each iteration 
of a loop.  It only takes a second to realize that this will break a lot 
of existing code.  Shane proposed the adding of two attributes: 
tal:repeat-define and tal:repeat-condition.  Others have proposed 
changing the order of operations.  I have yet to see any proposed new 
order (probably my mistake.)

<opinion>
I like Shane's idea of adding two new attributes.  It doesn't break 
existing code.  I suppose the order of operations with the new 
attributes would be

1. define
2. condition
3. repeat
    a. repeat-define
    b. repeat-condition
4. content or replace
5. attributes
6. omit-tag


If we change the order to something like

1. repeat
2. define
3. condition
4. content or replace
5. attributes
6. omit-tag

then any repeat which previously used  tal:defined variable will have to 
be wrapped with a <div tal:define="">.  That's silly.
</opinion>

/me dons flameproof armo(u)r

Troy

Tom Deprez wrote:
>>My propsoal would be to change the order in the next major Zope/ZPT
>>version, advertise and document the fact, and provide a helper script
>>or two that would analyse lumps of TAL code and/or whole ZODBs for
>>occurences of statements that would be affected by the change and
>>report them.
>>
>>What do people think?
> 
> 
> To jump in the discussion, can I get a summarised version of the possible
> new order and why specifically that order.
> 
> Greets,
> Tom