New #eval directive available

Keats Kirsch <[email protected]>
Newsgroups gmane.comp.java.webmacro.user
Message-ID <[email protected]>
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.

I also added a simple StringMacro class (in org.webmacro.engine) that 
creates a Macro from a WMScript string.  It is used internally by the 
EvalDirective and may be useful to others.

Keats




-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions.
Download our HomeAdmin security software for free today!
http://www.demarc.com/info/Sentarus/hamr30
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.