GitHub user spmallette opened a pull request: https://github.com/apache/incubator-tinkerpop/pull/238
TINKERPOP-1107 Added interpreter mode for ScriptEngine https://issues.apache.org/jira/browse/TINKERPOP-1107 Configuration for the `ScriptEngine` that allows the user to send `def` top level variables in a script and have them be treated as "global". Traditionally, for a script like this: ```groovy def x = 1 int y = 2 z = 3 ``` the variables `x` and `y` would be local to that script only while `z` would be preserved globally for future scripts. Users can find that confusing especially when using issuing script to Gremlin Server in a "session". When enabling "interpreter mode", all of the above variables assignments will be treated as global. VOTE +1 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/incubator-tinkerpop TINKERPOP-1107 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-tinkerpop/pull/238.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #238 ---- commit c05b1337bc63f1a2d3a7bd2af669e594f2a19e45 Author: Stephen Mallette <sp...@genoprime.com> Date: 2016-02-18T15:47:28Z Allow ScriptEngine to accept scripts in interpreter mode. Scripts sent with variables normally considered "local" by use of the def keyword or the inclusion of a type will be treated as global variables when the InterpreterModeCustomizerProvider configuration is included in the configuration of the ScriptEngine. commit 9c78b807ce3728b3b7703bbe5e88b5ddb46c4dd0 Author: Stephen Mallette <sp...@genoprime.com> Date: 2016-02-19T15:05:41Z Added some more asserts around variable scoping with interpreter mode. ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---