[Zope] Syntax: Learning from JSP's problems

Tres Seaver tseaver@palladion.com
Fri, 11 Feb 2000 12:30:26 -0600


Michael Bernstein <webmaven@lvcm.com> wrote:

<snip> 

> The one thing that DTML lacks is a simpler way of passing parameters to
> methods. I would suggest allowing syntax such as <dtml-tag a
> name="&value;"> to pass name/value pairs into methods (including python
> methods) letting the target methods worry about validating incoming
> parameters and default values. this would be much clearer than using the
> current REQUEST syntax.

We could perhaps hack the var tag to pass along any non-standard attributes as
keyword arguments:

  <dtml-var myMethod foo="bar"> # inject foo="bar" into myMethod's namespace

Of course, then we have to escape the standard attributes used by the var tag
itself, or else decorate all the "keyword" attributes:

  <dtml-var myMethod dtml:foo="bar">

Such a syntax would remove most of the need for the expr="" stuff, which
requires that unintuitive '( _.None, _, ...)' bit.  It replaces some uses of the
let tag, too, although I often have the let active across a whole method.

-- 
=========================================================
Tres Seaver         tseaver@palladion.com    713-523-6582
Palladion Software  http://www.palladion.com