[Zope-dev] Re: [ZPT] Order of attribute execution Feature Request

Tim Hoffman timhoffman@cams.wa.gov.au
10 May 2002 09:07:26 +0800


Hi

Just my 2c worth, but I would like to defend order of execution of 
ZPT. What it does mean for me is I can guaruntee zpt commands will
"always" be processed in a known order irrespective of where you 
put them in a tag, this I like ;-)

What I do miss is "else"  clause  but I think it would be probably
be too hard to implement, and too much of encouragement for people 
to start putting more logic in the template, so on the whole it
is probably best to leave it out.

See ya

T
On Fri, 2002-05-10 at 05:15, Jim Penny wrote:
> On Thu, May 09, 2002 at 04:07:14PM -0400, Ken Manheimer wrote:
> > On Thu, 9 May 2002, Dieter Maurer wrote:
> > 
> > > Chris Withers writes:
> > >  > Jim Penny wrote:
> > >  > > 2) that is introduces some additional, fairly baroque magic in the
> > >  > > "order of execution of element type" definitions.  I would have
> > >  > > preferred that they be evaulated/performed in textual order.
> > 
> > This is a case where i'd say "baroque" is intemperate.  The documention 
> > ( http://dev.zope.org/Wikis/DevSite/Projects/ZPT/TAL%20Specification%201.4 )
> > not only specifically declares the order of operations operations, but it 
> > goes on to describe the rationale behind them!
> > 
> > 
> > Now, if you _disagree_ with the choices, and can cite cases which
> > substantiate your reasoning, then great, file a collector issue!  But
> > calling it baroque implies that it's overelaborate and/or obscure to the
> > informed user - neither of which seems, to me at least, to be the case.
> > 
> > >  > I'd second that... where do we stick feature requests like this?
> > 
> > I would assume it's the Zope collector.  I suppose you could add comments
> > in the ZPT wiki, as well.  If you see a glaring error, and feel it
> > warrants stirring up a lot of attention, then post something to zope
> > coders - but you've both been pretty vague about your complaints, i don't
> > have the impression you are chafing from some particular error.
> > 
> 
> Now, Ken, I think you ought to reread the thread.  Chris has
> consistently defended ZPT, except for this one "feature".  I am
> ambivalent towards ZPT, but have stated that I will be, and am in fact, 
> moving towards using them nearly exclusively.  I am in this because I 
> felt that someone was being dumped on for daring to suggest that DTML 
> is at least cosmetically better.  
> 
> I have also said that, while ZPT is not as warty as DTML, ZPT looks,
> on the surface, to be pretty ugly.  I have said that there are three
> specific things I dislike about ZPT -- 0)  lots of things have changed
> spelling again -- request v. REQUEST, here v. context v. container v.
> this v. ? 1) infix notation that makes program scansion hard, 2) the 
> order of operations, which I think is baroque.  Six levels of precendence 
> for eight statements is pretty amazing.  And it is certainly harder to 
> explain/remember than "things happen in the order you specify."
> 
> I will add a fourth nit -- I cannot see why attributes should be plural
> when every other command is singular.  Certainly it feels like attribute
> ought to be an acceptable spelling of the atttributes command!
> 
> Now I will turn around and say what I do like about ZPT.
> Well-formed-ness is indeed nice.  The reduction of magic in variable
> lookup is nice.  The "| nothing" convention is very nice when used
> content or replace statements -- it makes it very easy to use the same
> form for both input and error processing -- something that is almost by
> itself worth the price of admission.  In fact, this is not really
> mentioned in the ZopeBook or ZPT Reference, it is shown only (on page
> 143) in combination with an unnecessary condition command.  I also missed 
> the "| default" convention that I can see as very useful.
> 
> My most-missed DTML feature has not been mentioned at all -- it is not
> loop batching -- it is the dtml-else option of dtml-in -- which made it
> much easier to handle the "nothing found" case.
> 
> I also have not found a convention that I am comfortable with on
> handling check-boxes and radio buttons in error processing.  But I
> expect to!
> 
> Jim Penny
> 
> 
> > > I think the order is irrelevant because the DOM considers
> > > attributes unordered. Not good to implement things against the standard
> > > model.
> > 
> > Attributes are unordered in the traversal, but of course the processing of 
> > the resulting structure (the semantics) is up to the application!  And the 
> > documentation is very clear about how the application behaves - with good 
> > motivation.
> > 
> > > Furthermore, changing this facet in the implementation will break
> > > lots of exiting templates.
> > > 
> > > Where do we condemn feature requests like this?
> > 
> > :-)
> > 
> > I imagine whoever is responsible for PageTemplates will float a proposal
> > for changes if they're convinced any are necessary.
> > 
> > -- 
> > Ken
> > klm@zope.com
> > 
> 
> 
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )