[Zope] The Set tag, DC?

Casey Duncan cduncan@kaivo.com
Tue, 12 Jun 2001 14:20:52 -0600


"Thomas B. Passin" wrote:
> 
> Colf Fusion has a "set" tag - <cfset> - easy to use and understand - I
> strongly favor having one in Zope.
> 
> Cheers,
> 
> Tom P
> 

I would like to argue for the following:

That DTML methods and documents have scratch namespace that is created
at the top of the stack before the code is executed. This namespace
would be initially empty and automatically scoped so that it is popped
off when the method completes. This would give DTML a true local
variable space, at little expense.

This way a "dtml-set" or "dtml-eval" tag could store there values in
this namespace instead of using REQUEST at the bottom of the stack,
which I feel leads to newbie frustration, since in every other langauge,
local variables override global ones, not the other way around. It
should also be backwards compatible since REQUEST.set would continue to
function just as before.

I wrote the eval tag which attempts approximate this functionality
(still using REQUEST though), and I always thought this would be the
best way to extend it. I think a fishbowl project is warranted here, I
would be willing to write it up if there is support.

For those otherwise unaware of dtml-eval, it lets you do this:

<dtml-eval>
    x = _.len(sequence)
    y = sequence[0]
</dtml-eval>

Basically write expressions in blocks without quoting and optionally
assign them to namespace variables.

-- 
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>