apatrida
01/04/2017, 11:05 PMMany script engines maintain state of global variables and functions between calls to eval(). However, it is important to note that the Java scripting API does not require script engines to supply this feature. The JavaScript, Groovy, and JRuby script engines used in this article do maintain state between calls to eval().but it looks like they maintain that state into the Bindings and not independently. But if you aren’t crossing script engines, I don’t think it really matters for most uses of scripting (no one checks to see if all state is there)