Re: New #eval directive available

Keats Kirsch <[email protected]>
Newsgroups gmane.comp.java.webmacro.user
Message-ID <[email protected]>
Endre Stølsvik wrote:

>On Fri, 1 Apr 2005, Keats Kirsch wrote:
>
>| I posted the new #eval directive last night, along with a couple of unit
>| tests for the new functionality.  I'll try to update the Wiki page soon.
>|
>| In a nutshell, you can now use Strings containing WMScript, instead of
>| Templets or other Macros, with #eval.  E.g.,
>|
>| [#eval "\$a \$b" using { "a":"Foo", "b":"Bar" }]
>|
>| would expand to:
>|
>| [Foo Bar]
>|
>| If you leave off the "using" clause, the current context will be used, e.g.,
>|
>| #set $a="Foo"
>| #set $b="Bar"
>| [#eval "\$a \$b"]
>|
>| would give the same result as above.
>
>What if I'd like a mix? I want the current context (copied), but I want to
>"override" this and this and this variable? I see this as an immediate
>useful feature.
>  
>
You have two choices: use the $OutVars with a new context, or set and 
restore the variables in the current context.  (I want to keep things as 
simple as possible.)

Cheers.

Keats

>Regards,
>Endre,
>
>(PS: Dear developers: remember that there is also a possibility of a 2.1,
>2.2 etc.. 2.0 won't -ever- come out, will it?!)
>
>
>
>
>  
>




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.