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

Evan Simpson evan@4-am.com
Wed, 22 Jan 2003 10:55:16 -0600


Quick recap:  We want to change the order of operations from "define, 
condition, repeat, etc" to "repeat, define, condition, etc" without 
breaking existing templates or causing mysterious failures when New 
Order templates are used in an Old Order installation, or when Old and 
New are mixed via macros.

The first step is a TAL release in which the Old Order is the default, 
but specially flagged templates get the New Order.  The flagging syntax 
should cause a consistent error in older TAL releases.  There will be a 
simple tool to find templates with "ambiguous" syntax, i.e., they have 
tal:repeat and tal:condition or tal:define on the same tag, and no New 
Order flag.

The next TAL release issues warnings for templates with "ambiguous" 
syntax.  I separate this from the first step in order to give people 
time to switch to the New Order without being flooded with warnings. 
This may not be necessary.

Subsequent TAL releases use the New Order exclusively.  The behavior 
flag could be auto-dropped at this point, but *some* syntax will need to 
remain that causes a consistent error in old TAL releases.

Mixing Old and New Order templates through macros is not a problem at 
runtime; code from each template will use the order of that template. 
The problem is with source expansion.  I recommend that the expansion of 
  an "ambiguous" macro in a New Order template cause an error.

Now for a practical note.  The current TAL implementation is extremely 
clever, and horrendous (to me, at least) to understand and change. 
Supporting both New and Old Orders in the same release is hard, which is 
why I haven't done it.  I've wanted to do a major rewrite and 
refactoring for quite a long time now, and would do so before trying to 
implement this proposal.  So, unless someone else wants to tackle this, 
it's going to have to wait until I get a Round Tuit, which is hidden 
somewhere in my Ample Free Time.

Cheers,

Evan @ 4-am