[Zope-dev] (whoops, hit send too early) Re: local/set (was RE: Zopedirection and 2.2roadmap...)direction and 2.2roadmap...)

Evan Simpson evan@4-am.com
Fri, 10 Dec 1999 13:40:01 -0600


"Phillip J. Eby" wrote:

> Let: allows read-only variables to be computed whose values are usable
> within a DTML nesting scope.
>
> Local: allows writable variables to be computed, whose values are usable
> and changeable within a DTML nesting scope.
>
> Set: singleton tag that changes the value of a "local" variable, as long as
> it was defined in the innermost surrounding "local" block.

Given these use-cases, consider the following variant of Let:

<dtml-let x="1+1" person: firstname=" 'fred' " weight="180">
  <dtml-var x>, <dtml-var firstname>, <dtml-var "person.weight">
  <dtml-call "person.set('weight', 185)">
  <dtml-var weight>
</dtml-let>

That is, every variable set after a colon-terminated singleton 'foo:' is also
a mutable (through .set()) attribute of 'foo'.

Cheers,

Evan @ 4-am