CHANGES ======================================================================= Changes from Pnuts 1.0beta8 to Pnuts 1.0beta9 ----------------------------------------------------------------------- LANG - use() Previously, functions in the package to which use() is applied are defined in the global package. As of this version, those functions are saved in the Context object. API - Pnuts.eval(String), Pnuts.loadFile(String), load(String), load(InputStream), load(Reader), and run() are deprecated to encourage to pass a Context object explicitly. - Pnuts.getClassLoader() is replaced by Context.getClassLoader() - Pnuts.setClassLoader() is replaced by Context.setClassLoader() - PnutsFunction.call(Object[]) is deprecated to encourage to pass a Context object explicitly. - pnuts.lang.Package::reset() is deleted. - pnuts.util.LocaleAdapter is deprecated. - Pnuts::registerQuantityFactory() is replaced by Context.registerQuantityFactory(). - pnuts.ext.SynchronizedFunction class is added. - pnuts.servlet.URLEncoding class is added. Other - pnuts::servlet module is provided to make servlet scripting easier. (examples) - "this" variable is defined in servlet scripts. - pnuts::regex module is provided. - print() and println() function take arbitrary number of parameters - Synchronized Function, sync() - The locale() function is replaced by the series of formatXXX functions. - Bug fixes. ======================================================================= Changes from Pnuts 1.0beta7 to Pnuts 1.0beta8 ----------------------------------------------------------------------- LANG - The builtin function use() is extended. - When a function is defined in the use()'d package, the variable of the function is also defined in the global package. - use("a::b::c") loads 'a/b/c/init.pnut' if it exists. - use() returns the list of the package names that have been use()'d. This change is related to Modules. - require() is a builtin function as of this version. API - Servlet Scripting - JSP Tag Library for Pnuts - PnutsImpl class defines the interface of the script engine. - URL can be passed to Pnuts.load(), load() - Context.get(), Context.set(), and Context.keys() are added. The purpose of these methods is to define variables which is indendent of syntactic scope. - pnuts.ext.JavaAdapter moved to pnuts.compiler.JavaAdapter - pnuts.compiler.CodeLoader is package protected - pnuts.ext.PnutsClient, pnuts.ext.PnutsProxy, and pnuts.ext.SimpleProxy are deleted. - pnuts2java translator is deleted Other - Visual Debugger - COM object can be accessed through JNI - property "pnuts.engine" and "pnuts.loadpath" are deleted, "pnuts.debugger" is added. - Standard scripts are grouped into two packages: "pnuts::lib" and "pnuts::util". - examples/regex/* ======================================================================= Changes from Pnuts 1.0beta6 to Pnuts 1.0beta7 ----------------------------------------------------------------------- Lang - Unicode escape notation is added. "\u0041", '\u0041' - Syntax of if-else statement. newline is allowed before 'else' keyword. - The delimiter of nested functions name changes from '$' to '.' API - Exception handling In the previous versions, exceptions are caught within a call of Pnuts.eval(), Pnuts.load(), and Pnuts.loadFile(), unless the script is evaluated with a ManualContext. As of this version, exceptions propagate to the caller of those methods even when a normal Context is passed. - PnutsFunction.added() method is added. - PnutsFunction.getId() method is deleted Other - variable '$args' - Cryptography functions - Personal Server is now supported on Windows. ======================================================================= Changes from Pnuts 1.0beta5 to Pnuts 1.0beta6 ----------------------------------------------------------------------- Language - Question mark (?) can be used in identifiers. - class("class_name") returns null when the class 'class_name' is not found. - Package hierarchy is introduced. API - pnuts.lang.Package(String, Package) and Package.getParent() are added. - pnuts.lang.PackageFactory.createPackage(String, Package) - pnuts.ext.ScriptPackage is added. - Function $() returns pnuts.ext.ScriptPackage e.g. c = function (this) $( function m1() this.getClass(), function m2() this.hashCode() ) i = c("hello") i.m1() i.m2() - pnuts.ext.JavaAdapter class is added. - Subclassing Java classes e.g. a = javaAdapter(Object, $(function hello() "hello")) a.hello() - A new function makeProxy() maps Method/Constructor to a function in order to optimize method/constructor call, by skipping method/constructor search. e.g. for(i=0;i<10000;i++) System::arraycopy(src, 0, dest, 0, src.length) can be optimized as below. arraycopy = makeProxy(System.getMethod("arraycopy", [Object, int, Object, int, int])) for(i=0;i<10000;i++) arraycopy(src,0,dest,0,src.length) - pnuts.ext.PnutsClient(CodeSource) is added. - pnuts.lang.PackagePermission is added. Other - Secure mobile script now supports on-the-fly compiler mode. - util/security.pnut is added. - lib/adapter.pnut and lib/event.pnut were rewritten. - '-f' option of the pnuts command. - bug fix ======================================================================= Changes from Pnuts 1.0beta4 to Pnuts 1.0beta5 ----------------------------------------------------------------------- Language - Arithmetic operations of characters, shorts, bytes are defined 'A' + #1 ==> 66 'A' + 1.0 ==> 66.0 ('A' > 60) ==> true - In Array comparison, elements are comapared by Object.equals() method, not Arithmetic.compareTo() method. ([1.0] == [1.0f]) ==> false - A new builtin function, class(fully_qualified_name) class java.lang.Object == class("java.lang.Object") - The word 'catch' is reserved. API - The method signature of pnuts.lang.AbstractData and pnuts.lang.Property. - New classes: - pnuts.ext.PnutsBSFEngine - pnuts.ext.PnutsObjectInputStream - pnuts.ext.PnutsComparator - pnuts.ext.PropertyAccessor - pnuts.compiler.ClassFileHandler - The return type of pnuts.compiler.Compiler#compile(PnutsFunction) changed from void to PnutsFunction. Other - New functions: sort, random, md5, base64encode, mkdir, accessor, find, etc. - Local variables can be accessed in debugger. - Bug fixes ======================================================================= Changes from Pnuts 1.0beta3 to Pnuts 1.0beta4 ----------------------------------------------------------------------- Language - The scope rule of eval() function and defined() changed. These functions can no longer refer local variables in the caller's scope. e.g. function func(x) eval("x"); func(1) ==> error function func(x) defined("x"); func(1) ==> false - A new builtin function, use(pkgName). - A new syntax `...` to create a string. e.g. `a = "A"` ==> "a = \"A\"" API - pnuts.tools package is added. - pnuts.compiler package is added. To enable the on-the-fly compiler, set the property "pnuts.engine" to "pnuts.compiler.Compiler" at the startup time . e.g. java -Dpnuts.engine=pnuts.compiler.Compiler className 'pnuts' command uses the on-the-fly compiler by default. To use the pure interpreter, specify '-pure' option. e.g. % pnuts -pure - Two methods are added in pnuts.lang.PnutsInterpreter to be able to use the pure interpreter explicitly. public Object accept(Pnuts pnuts, Context context) public Object load(Reader reader, boolean interactive, Context context) - pnuts.lang.AutoloadHook interface is added Other - loading compiled classes - setClassPath() function This function allows to change the classpath dynamically. - compile() function e.g.(1) p = compile("1"); p.run() e.g.(2) compile(aFunction) - "pserv" and "psh" command are added. - '-d' option of 'pnuts' command is for the Pnuts debugger. - "pnutsc" command is added. - Bug fixes ======================================================================= Changes from Pnuts 1.0beta2 to Pnuts 1.0beta3 ----------------------------------------------------------------------- Language - type cast expression e.g. (int)3.9 ==> 3 (int[])[1,2,3] ==> new int[]{1,2,3} object.method((int[])null) // the type infomation is used to select a method/constructor (String)123 ==> throws ClassCastException - assignment to array_or_string[from..to] e.g. a = [1,2,3]; a[0..1] = 0 => [0,0,3] b = "ABC"; b[0..1] = 'Z' => "ZZC" c = "ABC"; c[0..1] = "Z" => "ZC" - assignment to string[index] e.g. a = "123"; a[0] = '0' => "023" - arbitrary length arguments of function e.g. function array(args[]) args array(1,2,3,4) -> [1,2,3,4] - for statement gets closer to Java - '\0' and "\0" - syntax @class_name is deleted. - array.sublist() is deleted API - pnuts.lang.ManualContext, a subclass of Context, is defined. Context.setErrorStream(null) has no effect on how exceptions are caught in the interpreter as of this version. An exception during an execution with ManualContext is thrown out of the static method call of pnuts.lang.Pnuts class. - Context.setName(String) and getName() are added. The name of a context appears in an error message. - Context.defaultXXXXStream is final - Context.set()/get() are protected (not public) - Pnuts::parse() makes a pnuts.lang.Pnuts instance. - Pnuts.run() is added. - Pnuts.accept() is added. - pnuts.lang.Pnuts implements Serializable - pnuts.lang.PackageFactory interface is defined - Package::setPackageFactory() method is added - pnuts.lang.Indexed interface is added - return type of PnutsFunction.unparse(int) is changed - PnutsFunction.getPackage(int), PnutsFunction.getImportEnv(int) are added Other - pnus.trans package is added. This package implements a Pnuts-to-Java translator. - pnuts.ext.PnutsClient (based on JDK1.2 security) With this class, remote scripts can be executed as safely as Java applets. - pnuts.ext.ProtectedPackage In this type of package, only exported names are visible from other package. - VBScript emulation and OLE adapter (based on MS Java com.ms.com package) - bug fixes ======================================================================= Changes from Pnuts 1.0beta1 to Pnuts 1.0beta2 ----------------------------------------------------------------------- Language - <, <=, >, >=, ==, != are defined for java.lang.Comparable. - array[from..to] e.g. a = [1,2,3]; a[0..1] => [1,2]; a[1..] => [2,3] This obsoletes array.sublist(). - string[from..to] ==> string.substring(from,to+1) string[from..] ==> string.substring(from) string[idx] ==> string.charAt(idx) - expressions like "1." are no longer allowed. - primitiveType(obj) is defined. e.g. int("123") ==> 123 API - Context::defaultXXXXStream - Return type of Context.getXXXStream() - Constants of pnuts.lang.Numeric - pnuts.util.LocaleAdapter - pnuts.demo.* ==> demo.* Other - The default pnuts_load_path is ["/"] - lib/init.pnut moved to init.pnut - error messages are in pnuts.properties - INT(),BYTE(),SHORT(),... are replaced by int(),byte(),short(),... - locale() is added - propertyEditor() is added - array() and arrayType() are deleted - demo.decimal.Decimal - bug fixes - source code and binary code license agreement ======================================================================= Changes from Pnuts 0.93 to Pnuts 1.0beta1 ----------------------------------------------------------------------- Language - type[] creates an array type - type[int] creates an array instance API - new - PnutsFunction.unparse(int) - Pnuts.load(Reader, ...) - Pnuts::setVerbose(boolean), Pnuts::isVerbose() - Types.callMethod(...), Types.callConstructor(...) - modified - pnuts.lang.Package - PnutsFunction.call(...) is final - Context.setXXXStream(Object) - pnuts.ext.PSEPackage - pnuts.ext.DynamicClass - deleted - pnuts.lang.PnutsError Other - verbose option "-v" of "pnuts" command - setVerbose(boolean) function in lib/init.pnut - The use of pnuts.ext.DynamicClass is simplified - pnuts.permitUndefined and pnuts.import are deleted - int is renamed to INT and INT is renamed to int - supports javax.swing. - demo.* moved to pnuts.demo.* - examples/swing/fileViewer.pnut - Jama demo in examples/demo/matrix.pnut - bug fixes ======================================================================= Changes from Pnuts 0.92 to Pnuts 0.93 ----------------------------------------------------------------------- Language - quit() with one paramter terminates an interpreter session and Pnuts.load(), eval(), and loadFile() returns the value of the parameter. - return from the top level is equivalent to quit() Other - key mapping - pnuts.ext.PSEPackage - bug fixes quit() in foreach, while, or for statement - improved error reporting - performance tuning ======================================================================= Changes from Pnuts 0.91 to Pnuts 0.92 ----------------------------------------------------------------------- Language - undefined variable can not be used as of 0.92. e.g. > x ==> throws an exception, because 'x' is not defined. > x = null null > x null This is another incompatible change. When the property "pnuts.permitUndefined" is not null this change is ignored. If you need this property for compatibility, please let us know. If no one responds it will be deleted in the future. - defined(), a new builtin function, checks if the specified symbol is defined. e.g. > defined("x") false - comparison operators (<, >, ==, >=, <=) for String objects are based on String.compareTo() method. e.g. "A" < "B" ==> true Other - pnuts.ext.JarClassLoader class - bug fixes ======================================================================= Changes from Pnuts 0.90 to Pnuts 0.91 ----------------------------------------------------------------------- Language - import() function takes a full-qualified name as in Java. e.g. import("java.awt.Frame") import("java.awt.*") instead of import("java.awt") This change breaks compatibility with older versions. When the property "pnuts.import" is "old" this change is ignored. In this case you have to copy $PNUTS/lib and $PNUTS/util from the distribution package of version 0.90. If you need the property "pnuts.import" for your product please let us know. If no one responds it will be deleted in the future. Other - pnutool works on JavaStation and IE4.0 - Package can be customized. See src/demo/pkg/MyPackage.java - syntax error can be caught. See Pnuts User's Guide. ======================================================================= Changes from Pnuts 0.80 to Pnuts 0.90 ----------------------------------------------------------------------- Language - suffix 'b' or 'B' for BigDecimal. e.g. 1.2B makes a BigDecimal("1.2"). - the syntax rule is a little more relaxed e.g. var = expression - some interfaces are defined for syntax extension - arithmetic operation (pnuts.lang.Numeric) e.g. complex(1,2) + complex(2,3) - plugable unit systems (pnuts.lang.QuantityFactory) e.g. 1cm, 3in - dot notation (pnuts.lang.Property, pnuts.lang.AbstractData) e.g. obj.age = 18 ==> obj.set("age", 18) - autoload() is not only for functions. Other - pnuts.ext package is provided separately from the JAR file. The classes in the package are sample implementation of the syntax extension. - pnuts.lang.Package can be serialized - parameter of Context.setXXXStream() can be either Writer or OutputStream - Pnuts.load is unsynchronized - documents - bug fixes ======================================================================= Changes from Pnuts 0.72 to Pnuts 0.80 ----------------------------------------------------------------------- Language - new builtin functions - quit() terminates the evaluation of the current InputStream without reading EOF. - catch() defines an exception handler in the stack frame. bindException() and unbindException() are deleted. - com.sun.java.util.collections.Iterator can be used in foreach statement, although it may not be included in the final spec. depending on how common the 1.1-collection will be. - The pnuts_class_loader variable is deleted for a security reason. Instead, Pnuts::setClassLoader(ClassLoader) is used. This change enables to restrict class access by defining a custom ClassLoader. - The name of nested functions are no longer accessible in global scope. - Syntax became a little more generous if (true) {} for (i = 0; i < 10; ) i++ Other - Package.elements() to enumerate sub-packages - PnutsFunction.getId() is added - Pnuts::callDepth() is deleted - pnuts.tool.* are deleted - more reliable error reporting - better swing support - document, demo - bug fixes ======================================================================= Changes from Pnuts 0.71 to Pnuts 0.72 ----------------------------------------------------------------------- Language - more efficient implementation: both size and speed - import() to show imported packages - import(null) to clear the imports - bug fixes Other - pnuts-core.zip which provides minimum classes ======================================================================= Changes from Pnuts 0.70 to Pnuts 0.71 ----------------------------------------------------------------------- Language - post-increment, post-decrement expression; e.g. i++, i-- - new keyword: continue - bug fixes Scripts - /util directory ,to which some scripts moved from /lib. This change makes /lib smaller. - divided /examples into several subdirectories API - Pnuts::set() is added for convenience. Other - English license terms itself is effective, not just a translation from Japanese. - Separate JDK1.1 version and JDK1.2 version - FAQ ======================================================================= Changes from Pnuts 0.61 to Pnuts 0.70 ----------------------------------------------------------------------- Language - 'class' became a keyword that indicate a class as '@'does. e.g. class java.lang.Object - Lexical scope for nested functions - Hierarchical package names e.g. package("a::b::c") - reorganize builtin functions - A new special variable 'pnuts_class_loader' - Improved error reporting - Syntax rule became a bit more generous - "0xff" style for Integer, "#ff" style for Byte API - Package names changed to pnuts.lang.*. - Context class - Pnuts.eval() - PnutsFunction.call() - PnutsLayout Function - import() function e.g. import("java.awt") - package() To get current package - getContext() To get current context - Type conversion functions in lib/primitive.pnut int(string), byte(string), ... - layout() - handleException() => bindException() - unhandException() => unbindException() - make_array() => array() Other - Sample Scripts - Command-line options - .pnuts => lib/init.pnut ======================================================================= Changes from Pnuts 0.60 to Pnuts 0.61 ----------------------------------------------------------------------- Thread Priority Control - In 0.60 AWT script may need to lower the priority at the bottom of the script. This change is to eliminate this. The interpreter loop reset the thread priority to Thread::NORM_PRIORITY before the execution and Thread::NORM_PRIORITY-2 afterward. As changing priority is security sensitive operation in HJ, this change is only for standalone programs. Foreach statement - foreach statement handles java.util.Iterator class as well, which will be included in JDK1.2. API refinement - PnutsFunction class Additional Sample Scripts - examples/shell.pnut Bug fix - pnuts ksh script - eliminate VerifierError caused by javac -O option. ======================================================================= Changes from Pnuts 0.55 to Pnuts 0.60 ----------------------------------------------------------------------- Language - Packages (no longer function as structure) See the language specification. - Object array to Primitive array conversion Pnuts Array is automatically converted to relevant types when a method is invoked. e.g. outputStream.write([#ca, #fe, #ba, #be]). - Anonymous function e.g. bind(frame, "windowClosing", function(e) e.getSource().dispose()) Event Adapter - In 0.55 bind() function can hook up pre-defined set of events to listener. In 0.60 bind() can deal with user-defined EventListener. - bind() function's 2nd parameter's type is String. Additional Sample Scripts - HotJavaBrowserBean - Swing Bug fix - Arithmetic expression - Scope rule - pnuts.loadpath parsing for Windows