
Saturday July 22, 2006
More updates to scripting.dev.java.net
Recent updates to scripting.dev.java.net:
- Updated Scheme JSR-223 script engine to use the latest version (1.15.1) of SISC (Second Interpreter of Scheme Code) intepreter. SISC supports is a complete implementation of the language. The entire R5RS Scheme standard is supported, no exceptions - including continuations!
- Updated OGNL (Object Graph Navigation Language) JSR-223 script engine to use the latest version (2.6.7) of the implementation. This is (lightweight) expression language for getting and setting properties of Java objects. I like the BigInteger and BigDecimal literals and direct operator support on those types.
- Fixed Groovy JSR-223 script engine to give an illusion of single engine level scope for functions. Previously, it was not possible to define a Groovy "global" function in one
ScriptEngine.eval() call and call the same in subsequent ScriptEngine.eval() calls. This is because internally, each eval'ed code is compiled as a separate ScriptXXX class. i.e., all global functions in the eval'ed code go into a class derived from Script class. To give an illusion of single engine level scope for "global" functions, we create a map of method closures from all ScriptXXX instances created and search there for global functions (using Groovy's MetaClass mechanism). With this change, the engine behaves as if there is a single global functions scope per ScriptEngine instance. Groovy's Meta Object Protocol (MOP) is really powerful indeed.
( Jul 22 2006, 10:09:47 AM IST )
Permalink

|

|

|

|

|
Posted by Alexis MP on July 22, 2006 at 12:58 PM IST #
function hello() { print("hello"); }andvar hello = function() { print("hello"); }are same. Did I answer your question?Posted by A. Sundararajan on July 23, 2006 at 09:40 AM IST #