[ZPT] Deafening chirping of crickets

Jeffrey P Shell jeffrey at cuemedia.com
Tue Apr 22 16:54:21 EDT 2003

On Tuesday, April 22, 2003, at 12:35  PM, Fernando Martins wrote:

> Chris Withers wrote:
>> Fernando Martins wrote:
>>> Chris Withers wrote:
>>>> I've never encountered this as a pointof irritation.
>>>> The order of execution of statements, yes, building if-then-else
>>>> using a couple
>>>> of tal:conditions, no...
>>> Was it ever considered to use line numbers (a la BASIC) to
>> change the order
>>> of execution (optional, just for an occasional HTML element)?
>> How would this look?
> Hmm, I didn't give much thought to it because I was expecting this
> possibility to have been discussed. Something like
> <tal:condition="10 python: a > 0"
>     tal:define="20 c python: b / a">


I say - the order of operations are as the order of operations are.  If 
it weren't for these discussions, I'd have no problem.  But now my 
stupid brain gets all confused and I have to look them up on occasion.  
It's like how I intrinsically knew right and left until drivers ed had 
to teach it to me and I had to actually *think* about it.  :)

>>> Still, this wouldn't solve the convenience of having a define, then a
>>> condition, then a define (depending on the truth of the condition).
>> I can coem up with one that has the first two bits, but what
>> would one with all
>> three look like?
> I don't have a real example right now but it looks like:
> <tal:define="a here/getSomeValue"
>  tal:condition="python: a > 0"
>  tal:define="c python: b / a">
> You probably want a more convincing case, because the first two could 
> be
> merged. But assume "a" is needed afterwards and getSomeValue is an 
> expensive
> operation you don't want to recalculate.

This is when it's time to write a helper script/function/etc.  Or join 
us in the happy land of twisted boolean logic.  :)

More information about the ZPT mailing list