[Zope] Use of lambda expression in DTML
Lalo Martins
lalo@hackandroll.org
Mon, 29 May 2000 16:33:20 -0300
On Fri, May 26, 2000 at 03:05:14PM -0700, Jonothan Farr wrote:
> > In brief: I get a NameError when invoking "filter(...)" from DTML. I thought
> > this was a built-in python method, so I'm a bit puzzled.
>
> Certain built-ins are not available in dtml for security and other reasons,
> filter and lambda are among them. As far as I know, you'll need to use an
> external method to do this or think of another way to do it in dtml.
One big question is: what's wrong with filter, map and lambda?
They can make a lot of code a lot simpler, specially for people
who have a background in functional programming.
IIRC there is nothing wrong with them - only that all builtins
were disabled and some specific few were re-enabled, and then
those three were overlooked.
Count one vote for getting them back (_.lambda, _.filter, _.map
is fine enough, of course).
[]s,
|alo
+----
--
Hack and Roll ( http://www.hackandroll.org )
News for, uh, whatever it is that we are.
http://zope.gf.com.br/lalo mailto:lalo@hackandroll.org
pgp key: http://zope.gf.com.br/lalo/pessoal/pgp
Brazil of Darkness (RPG) --- http://zope.gf.com.br/BroDar