[Zope] Proposal: Include tino's patched <dtml-in> in future Zope

Itai Tavor itai@optusnet.com.au
Wed, 28 Feb 2001 10:28:34 +1100


Toby Dickenson wrote:

>On Tue, 27 Feb 2001 09:56:17 +1100, Itai Tavor <itai@optusnet.com.au>
>wrote:
>
>>citing some irrelevant concern about polluting the namespace.
>
>namespace pollution is less serious if you have a greater number of
>namespaces, and more serious if you have fewer.
>
>dtml is the only language I know which only provides *one* namespace.

Ok, so namespace pollution might be a valid argument against the 
prefix patch. But as Chris and Tino pointed out, it's irrelevant for 
sequence_xxx - and that's the patch that has been repeatedly 
requested on the list and rejected by DC.


Chris Withers wrote:

>Sorry to jump in here, but can we please not let this argument rob us of yet
>another chance to get a nice alternative to such abominations as:
><dtml-var "_['sequence-item']*3">
>
><dtml-var "sequence_item 3"> is much nicer :-)
>
>Tino, is there any chance you could split your dtml-in patch into two so that
>the contraversial bit can be argued over while not impeding the most 
>useful bit?
>
>please?!
>
>Chris

Hey, that's just what I wanted to say!

I vote that that sequence_xxx aliases be added to Zope 2.3.1, while 
discussions on the prefix patch can continue. I personally don't care 
about this one - I never met the need for it. But I use sequence_xxx 
names in preference to _['sequence_xxx'] all the time, and I've seen 
no good argument against adding it to the core.

But then, votes only count in a democracy.


Toby Dickenson wrote:

>IMO the *real* answer is to not implement logic in dtml. The problems (and
>the need for this patch) go away.

People keep telling us DTML coders this. I would really like to see 
some of your code, because I just don't get it.

Formatting HTML is a whole lot easier in DTML than in python. A DTML 
document looks mostly just like the HTML it generates, plus some DTML 
tags. It's easy to read and it's easy for non-programmers to modify. 
HTML in python is a long ugly list of print statements or a bunch of 
messy variable substitutions on string constants. I just can't see 
what can possibly be simpler than a dtml-in loop.

dtml-in might be used for logic, and that would be a bad idea. But 
it's also used a whole lot for display formatting - and for that it's 
the best tool around. People keep talking about phasing DTML out. But 
if the alternative is formatting HTML in python, I'm outta here.


Itai
-- 
--
Itai Tavor                      -- "Je sautille, donc je suis."    --
itai@optusnet.com.au            --               - Kermit the Frog --
--                                                                 --
-- "If you haven't got your health, you haven't got anything"      --