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

Clemens Robbenhaar zpt@zope.org
Tue, 21 Jan 2003 16:40:31 +0100


Scott Burchill writes:
 > 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 on this from me as well.  I believe I will use this frequently as 
 > well.  Can anyone think of anything that "breaks" because of the change 
 > in operation order?  I can't.

 Yes, I can:

 <tal:block define="items here/get_some_items" repeat="item items"> 
   ... etc

"items" is actually the sequence the 'repeat' repeats over, and is
defined in the same block as the repeat. If the 'repeat' is executed
before the 'define', the sequence to be repeated over is undefined.


 Did I miss something here? I have not understand the "__future__"
import, I admit.

Cheers,
Clemens