[Zope] Use of lambda expression in DTML

Anthony Baxter Anthony Baxter <anthony@interlink.com.au>
Tue, 30 May 2000 22:32:36 +1000


>>> Chris McDonough wrote
> Nope.  Lamba, filter, reduce, and map should IMHO not be part of DTML. 
> Actually, exprs probably shouldn't be in there in the first place. 
> People are trying to use DTML as a way to process non-UI elements.  This
> is a slippery slope, and leads to something like PHP or ASP.  My opinion
> is this:  Generate and format your HTML with DTML, and do everything
> else in Python.  This gives you the added benefit that you can change
> the return values of functions by changing the Python code without
> having to muck with DTML, which is painful any way you look at it.

Until PythonMethods are back in the distribution, you can't stop people
from using DTML for this stuff - the only alternative is to give everyone
who ever needs to do something more than simple HTML access to the file
system. I can't see that happening on zope.org, or many other sites.

I agree whole-heartedly that DTML's expr syntax is nightmarish and needs
to be deprecated - but right now there's nothing to replace it with.

As far as the issue at hand - whether lambda/map/reduce/filter should be
allowed - the simplest way to enable them for PythonMethods also enables
them for dtml-expr. 

Anthony
-- 
Anthony Baxter     <anthony@interlink.com.au>   
It's never too late to have a happy childhood.