[Zope3-dev] Re: tal:define="..." considered harmful?

Tres Seaver tseaver at palladion.com
Mon Feb 13 10:13:34 EST 2006

Hash: SHA1

Lennart Regebro wrote:
> On 2/13/06, Tonico Strasser <contact_tonico at yahoo.de> wrote:
>>Looking forward to see explicit ZPTs soon :)
> Me too. I'd also like the macros to be called rather than expanded, so
> that any error messages report the error in the macro rather than in
> an expanded main template. This should be possible if we have explicit
> macro parameters.
> In fact, this would not only solve the two biggest problems with
> macros, it would make the macros functions, which is much better. If
> we don't want to break backwards compatibility, calling them functions
> would be a good idea.

That's a non-goal for me:  macros are *not* functions, and aren't
supposed to be "called":  the point of them is that they operate in the
context of the caller.  In addition to the loss of functionality (slots,
  as you note), calls are much more expensive than macros.

> Slots are however highly useful, and I'm not sure what to do about them.
> I'd also like to remove the python: prefix completely. No
> "tal:define", no "python:", no macros, but functions. Then I'd be
> happy. Question is: Is it still ZPTs? ;-)

No.  I would prefer to make it easier to avoid lots of 'tal:defines' and
Python expressions (e.g., by making it easier to define new top-level
names without deriving a subclass).  I don't want to force everyon to
adopt the practices which your world would require (trivial boolean
methods on the view to call from 'tal:condition', for instance).

It should be possible to tweak the template as it sits today, including
making it "messy", and then clean it up by extending the view class later.

- --
Tres Seaver          +1 202-558-7113          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org


More information about the Zope3-dev mailing list