File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Jython/Python and the fly likes script engines w/ no global environment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Languages » Jython/Python
Bookmark "script engines w/ no global environment" Watch "script engines w/ no global environment" New topic
Author

script engines w/ no global environment

Maria Log
Greenhorn

Joined: Dec 10, 2012
Posts: 1
I am curious about how global variables are handled by script engines. I am looking for a script engine that does not preserve the state of global variables upon invocation. Are there such engines out there? We are looking for a scripting language we can use under the script engine API for Java.

When making multiple invocations of a script engine, top-level calls to eval() or evaluate() method preserves the state of global variables, meaning that consequent calls to eval() will use the global variables as they were left by the last invocation. Is there a script engine that does not preserve the state, or provides the ability to reset the state, so that global variables are at their initial state every time the script engine is invoked?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: script engines w/ no global environment
 
Similar Threads
Using Java with an external scripting engine
evaluating string expressions in Java
Why to use eval function inside Javascript
How do I get search engine results programatically?
javax.script: Save state/scope between eval()s