wood burning stoves 2.0*
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
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
javax.script: Save state/scope between eval()s
How do I get search engine results programatically?
evaluating string expressions in Java
Why to use eval function inside Javascript
Using Java with an external scripting engine