[Zope] Simple function nightmare
R. David Murray
bitz@bitdance.com
Fri, 2 Jun 2000 11:07:46 -0400 (EDT)
On Fri, 2 Jun 2000, Felipe Alvarez Harnecker wrote:
> <let a="'1'"
> b="'2'"
> c="'3"
> d=dontWork_dtml
> <dtml-call "REQUEST.set('a','2')">
> <dtml-var d>
> </dtml-let>
>
> guess what:
>
> it renders
>
> 2-2-3
>
> That is d is not a string but an expression.
Hey, this is a cool trick <grin>.
What is happening here is that you are assigning the *function* to
d, not its result, so when you do the dtml-var, dtml calls the
function and it gets evaluated in the current context. If you make
your let expression something like (untested):
d="dontWork_dtml(_.None,_)"
I think you'll get the result you were looking for. (The _.None,_ pass
the namespace in to the method so that it can find a b and c.)
--RDM