[ZPT] unit testing new expression

delza@landry.alliances.org delza@landry.alliances.org
Mon, 1 Oct 2001 18:53:54 +0000 (Local time zone must be set--see zic manual page)


Evan Simpson wrote:
> 
> > 2) What do I need to do to make the namespaces of the PageTemplate 
> > available to the expression when it is called?  This is what I'm having 
> > trouble testing, so the two questions are intimately related.
> 
> When a compiled TALES expression object is called, a single Context object 
> is passed to it.  This has several namespaces as attributes.  'vars' is the 
> complete namespace, while 'local_vars' and 'global_vars' are dictionaries of 
> local and global names.  You can also use the Context object's 'evaluate' 
> method to evaluate other expressions.

Thanks for the help!

So, if I compile an expression and call it, is the Context built or do I need
to create that myself?  Do I need to instantiate and Engine first?  I'm having
trouble visualizing the flow of control here.

--Dethe


==========================================================================
|    dethe@burningtiger.com    |    http://livingcode.manilasites.com    | 
==========================================================================
"Well I've wrestled with reality for thirty-five years now, doctor, and I'm
  happy to state I've finally won out over it." -- Elwood P. Dowd, Harvey