[Zope3-dev] Re: Number of languages in Zope 3

Evan Simpson evan@4-am.com
Wed, 09 Apr 2003 15:34:10 -0500


Jim Penny wrote:
> I started out hating ZPT.

By this I take it that you have been won over, to some extent.
Nonetheless, I'd like to address your issues, since they *were*
considered in detail during the design of TAL, and even documented.

> there were a lot of precedence rules with no clear explanation of of
>  why they were there.

I quote from TAL spec v1.4:

'''The reasoning behind this ordering goes like this: You often want to
set up variables for use in other statements, so define comes first. The
very next thing to do is decide whether this element will be included at
all, so condition is next; since the condition may depend on variables
you just set, it comes after define. It is valuable be able to replace
various parts of an element with different values on each iteration of a
repeat, so repeat is next. It makes no sense to replace attributes and
then throw them away, so attributes is last. The remaining statements
clash, because they each replace or edit the statement element.'''

> Some keywords are verbs; some are nouns.  All but one of the keywords
>  are singular; but suddenly attributes is in plural.

The verb/noun mix is an unfortunate result of compromising between a
desire for imperative tone and for keeping verbosity (a little) under
control.  The uncompromising tone version would have been something
like: 'define-variables', 'conditionally-retain-element', 
'repeat-element', 'replace-element', 'replace-element-content', 
'replace-attributes', 'conditionally-omit-tag', and 
'on-error-replace-element'.  Yech.

The singular/plural mix is simpler -- only 'define' and 'attributes'
have (potentially) more than one clause, and 'define' already works well
with any number of clauses, by virtue of being a verb :-)

> There is the gratuitous renaming of 'container' to 'here'.

Not gratuitous, and not 'container'.  We used 'here' instead of 
'context', because 'context' is awfully generic, and we were referring 
to the *entire collection* of 'container', 'here', 'root', 'user', etc. 
objects as "contexts" (see the builtin TALES name 'CONTEXTS'!). 
Frankly, I wish 'here' replaced 'context' in Scripts as well.  It's a 
nice name, implying placefullness, which is the whole raisin d'eater of 
that "context".

> But, if 'explicit is better than implicit', you have to show the 
> parameters at call time.  Path expressions simply offer no support!

Yep.  This is a definite stumbling block.  At some point we may try to 
backfill with some kind of argument sytax, but that's a slope (from 
simple variable arguments, to paths, to general expressions as 
arguments) that makes a lot of people nervous.

Cheers,

Evan @ 4-am