[ZPT] Re: TAL's lack of an else...

Fergal Daly fergal at esatclear.ie
Wed Aug 6 18:51:37 EDT 2003


On Wednesday 06 August 2003 17:28, Daniël Hooymans wrote:
> I'm also not defending TAL for it's lack of IF/ELSEIF/ELSE construct. In
> the beginning I also wondered why there was no construct for something this
> 'basic'. As a matter of fact it would be nice to know WHY the developers of
> TAL did not implement an IF/ELSEIF/ELSE construct.

At a guess (just a guess) it's not because they object to if/else in principle 
but because they couldn't find a nice enough syntax. It's possible there is 
no nice enough syntax.

In order to know that 2 or more blocks of XML are related, you either need to 
label them somehow, wrap them inside another block (or put one inside the 
other) or notice that there is nothing between them (nasty) or do something 
else that I can't think of.

I think that some of those options are less verbose and less error prone than 
the current define and 2 conditions method but I guess not enough of an 
improvement for people to be happy with them.

> I can imagine the that an IF/ELSE construct would enable different markup
> at a position in the template which imposes problems for a graphical
> designer in an external editor.

Only slighly more than IF on it's own does and as I have pointed out, people 
already use condition=not:... when they want to. The unprocessed templates 
will never don't look exactly right (at least not without building a browser 
than understands TAL - that'd be cool)

F




More information about the ZPT mailing list