nice-commit Mailing List for The Nice Programming Language (Page 71)
Brought to you by:
bonniot
You can subscribe to this list here.
2003 |
Jan
|
Feb
(60) |
Mar
(125) |
Apr
(183) |
May
(140) |
Jun
(227) |
Jul
(141) |
Aug
(181) |
Sep
(75) |
Oct
(89) |
Nov
(187) |
Dec
(162) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(69) |
Feb
(197) |
Mar
(98) |
Apr
(26) |
May
(10) |
Jun
(85) |
Jul
(88) |
Aug
(79) |
Sep
(80) |
Oct
(81) |
Nov
(53) |
Dec
(109) |
2005 |
Jan
(68) |
Feb
(77) |
Mar
(232) |
Apr
(79) |
May
(37) |
Jun
(37) |
Jul
(3) |
Aug
(18) |
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
(10) |
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(9) |
2007 |
Jan
(2) |
Feb
(8) |
Mar
(2) |
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
|
Oct
|
Nov
(17) |
Dec
(6) |
2008 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ar...@us...> - 2003-11-30 14:24:38
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods In directory sc8-pr-cvs1:/tmp/cvs-serv18600/F:/nice/testsuite/compiler/methods Modified Files: integer.testsuite string.testsuite Log Message: Removed empty statements from the testcases. Index: integer.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/methods/integer.testsuite,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** integer.testsuite 21 Oct 2003 17:41:52 -0000 1.14 --- integer.testsuite 30 Nov 2003 14:24:35 -0000 1.15 *************** *** 40,44 **** /// package b import a ! ; /// PASS --- 40,44 ---- /// package b import a ! {} /// PASS Index: string.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/methods/string.testsuite,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** string.testsuite 23 Oct 2003 18:43:37 -0000 1.5 --- string.testsuite 30 Nov 2003 14:24:35 -0000 1.6 *************** *** 15,19 **** /// package b import a ! ; /// FAIL --- 15,19 ---- /// package b import a ! {} /// FAIL |
From: <ar...@us...> - 2003-11-30 14:24:38
|
Update of /cvsroot/nice/Nice/testsuite/compiler/native In directory sc8-pr-cvs1:/tmp/cvs-serv18600/F:/nice/testsuite/compiler/native Modified Files: instanceof.testsuite Log Message: Removed empty statements from the testcases. Index: instanceof.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/native/instanceof.testsuite,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** instanceof.testsuite 1 Apr 2003 20:25:10 -0000 1.5 --- instanceof.testsuite 30 Nov 2003 14:24:35 -0000 1.6 *************** *** 20,24 **** /// PASS if ("A" instanceof String) ! ; else throw new Error(); --- 20,24 ---- /// PASS if ("A" instanceof String) ! {} else throw new Error(); *************** *** 33,37 **** /// PASS if (true instanceof boolean) ! ; else throw new Error(); --- 33,37 ---- /// PASS if (true instanceof boolean) ! {} else throw new Error(); |
From: <ar...@us...> - 2003-11-30 14:24:38
|
Update of /cvsroot/nice/Nice/testsuite/compiler/classes In directory sc8-pr-cvs1:/tmp/cvs-serv18600/F:/nice/testsuite/compiler/classes Modified Files: export.testsuite initializer.testsuite native.testsuite Log Message: Removed empty statements from the testcases. Index: export.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/classes/export.testsuite,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** export.testsuite 16 Sep 2002 19:58:32 -0000 1.2 --- export.testsuite 30 Nov 2003 14:24:35 -0000 1.3 *************** *** 8,12 **** int f() = 0; /// package b import a ! ; /// PASS --- 8,12 ---- int f() = 0; /// package b import a ! {} /// PASS *************** *** 16,20 **** class A implements I {} /// package b import a ! ; /// PASS --- 16,20 ---- class A implements I {} /// package b import a ! {} /// PASS *************** *** 23,27 **** class A implements java.lang.Comparable {} /// package b import a ! ; /// PASS --- 23,27 ---- class A implements java.lang.Comparable {} /// package b import a ! {} /// PASS *************** *** 31,35 **** class A implements I, java.lang.Comparable {} /// package b import a ! ; /// PASS --- 31,35 ---- class A implements I, java.lang.Comparable {} /// package b import a ! {} /// PASS *************** *** 39,43 **** interface J extends I {} /// package b import a ! ; /// PASS --- 39,43 ---- interface J extends I {} /// package b import a ! {} /// PASS *************** *** 46,50 **** interface I extends java.lang.Comparable {} /// package b import a ! ; /// PASS --- 46,50 ---- interface I extends java.lang.Comparable {} /// package b import a ! {} /// PASS *************** *** 54,56 **** interface J extends I, java.lang.Comparable {} /// package b import a ! ; --- 54,56 ---- interface J extends I, java.lang.Comparable {} /// package b import a ! {} Index: initializer.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/classes/initializer.testsuite,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** initializer.testsuite 27 Nov 2003 21:02:12 -0000 1.12 --- initializer.testsuite 30 Nov 2003 14:24:35 -0000 1.13 *************** *** 140,144 **** while (k<5); ! ; try { --- 140,144 ---- while (k<5); ! {} try { Index: native.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/classes/native.testsuite,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** native.testsuite 7 Nov 2003 22:50:00 -0000 1.7 --- native.testsuite 30 Nov 2003 14:24:35 -0000 1.8 *************** *** 55,57 **** NonExist NonExist(long) = native new NonExist(long); /// package b import a ! ; --- 55,57 ---- NonExist NonExist(long) = native new NonExist(long); /// package b import a ! {} |
From: <ar...@us...> - 2003-11-30 14:24:38
|
Update of /cvsroot/nice/Nice/testsuite/compiler In directory sc8-pr-cvs1:/tmp/cvs-serv18600/F:/nice/testsuite/compiler Modified Files: globalVariables.testsuite Log Message: Removed empty statements from the testcases. Index: globalVariables.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/globalVariables.testsuite,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** globalVariables.testsuite 22 Aug 2003 13:36:40 -0000 1.13 --- globalVariables.testsuite 30 Nov 2003 14:24:34 -0000 1.14 *************** *** 111,115 **** let char x = 'x'; /// package b import a ! ; /// PASS --- 111,115 ---- let char x = 'x'; /// package b import a ! {} /// PASS |
From: <ar...@us...> - 2003-11-30 14:24:38
|
Update of /cvsroot/nice/Nice/testsuite/compiler/abstractInterfaces In directory sc8-pr-cvs1:/tmp/cvs-serv18600/F:/nice/testsuite/compiler/abstractInterfaces Modified Files: export.testsuite Log Message: Removed empty statements from the testcases. Index: export.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/abstractInterfaces/export.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** export.testsuite 16 Sep 2002 13:43:48 -0000 1.1 --- export.testsuite 30 Nov 2003 14:24:34 -0000 1.2 *************** *** 6,10 **** } /// package b import a ! ; /// PASS --- 6,10 ---- } /// package b import a ! {} /// PASS |
From: <ar...@us...> - 2003-11-30 14:24:38
|
Update of /cvsroot/nice/Nice/testsuite/compiler/functions In directory sc8-pr-cvs1:/tmp/cvs-serv18600/F:/nice/testsuite/compiler/functions Modified Files: anonymous.testsuite Log Message: Removed empty statements from the testcases. Index: anonymous.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/functions/anonymous.testsuite,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** anonymous.testsuite 26 Jul 2003 12:04:13 -0000 1.8 --- anonymous.testsuite 30 Nov 2003 14:24:35 -0000 1.9 *************** *** 56,60 **** } /// package b import a ! ; /// FAIL --- 56,60 ---- } /// package b import a ! {} /// FAIL |
From: <ar...@us...> - 2003-11-30 13:09:24
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv7529/F:/nice/src/bossa/syntax Modified Files: analyse.nice typecheck.nice MonoSymbol.java Log Message: Warning for unused local variables. Index: analyse.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/analyse.nice,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** analyse.nice 25 Nov 2003 10:41:10 -0000 1.91 --- analyse.nice 30 Nov 2003 13:09:20 -0000 1.92 *************** *** 452,455 **** --- 452,457 ---- if (sym instanceof MonoSymbol) { + sym.used = true; + if (assigned && sym.depth < info.anonFunDepth) sym.captured = true; Index: typecheck.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** typecheck.nice 25 Nov 2003 10:41:10 -0000 1.90 --- typecheck.nice 30 Nov 2003 13:09:20 -0000 1.91 *************** *** 687,696 **** typecheck(decl@Block.LocalVariable) { ?Expression value = decl.value; if (value == null) return; - MonoSymbol target = notNull(decl.left()); - ?mlsub.typing.Monotype type = target.getMonotype(); if (type == null) --- 687,699 ---- typecheck(decl@Block.LocalVariable) { + MonoSymbol target = notNull(decl.left()); + + if (! target.used) + bossa.util.User.warning(decl, " Unused local variable " + target.name); + ?Expression value = decl.value; if (value == null) return; ?mlsub.typing.Monotype type = target.getMonotype(); if (type == null) *************** *** 727,730 **** --- 730,736 ---- typecheck(decl@Block.LocalConstant) { + if (! notNull(decl.left).used) + bossa.util.User.warning(decl, " Unused local variable " + notNull(decl.left).name); + typecheck(decl.value); decl.value = notNull(decl.value).noOverloading(); Index: MonoSymbol.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MonoSymbol.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** MonoSymbol.java 24 Nov 2003 19:22:02 -0000 1.27 --- MonoSymbol.java 30 Nov 2003 13:09:21 -0000 1.28 *************** *** 164,167 **** --- 164,169 ---- int depth; + boolean used = false; + Monotype syntacticType; mlsub.typing.Monotype type; |
From: <bo...@us...> - 2003-11-30 11:39:32
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang/inline In directory sc8-pr-cvs1:/tmp/cvs-serv27335/stdlib/nice/lang/inline Modified Files: Assert.java Log Message: Make sure the constructors for AssertionFailed exist. Index: Assert.java =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/inline/Assert.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Assert.java 23 Apr 2003 09:21:52 -0000 1.4 --- Assert.java 30 Nov 2003 11:39:28 -0000 1.5 *************** *** 82,88 **** private static final Method ! errorInit = errorClass.getDeclaredMethod("<init>", new Type[]{}), ! errorInitString = errorClass.getDeclaredMethod ! ("<init>", new Type[]{Type.string_type}); public Type getReturnType (Expression[] args) --- 82,89 ---- private static final Method ! errorInit = errorClass.addMethod ! ("<init>", Access.PUBLIC, new Type[]{}, Type.void_type), ! errorInitString = errorClass.addMethod ! ("<init>", Access.PUBLIC, new Type[]{Type.string_type}, Type.void_type); public Type getReturnType (Expression[] args) |
From: <bo...@us...> - 2003-11-30 11:22:31
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1:/tmp/cvs-serv24988 Modified Files: Makefile Added Files: NEWS Log Message: Changes between versions should not go in the NEWS file, while debian/changelog is reserved for Debian-specific changes. --- NEW FILE: NEWS --- nice (0.9.5) * String concatenation can be performed by mere juxtaposition of string literals and simple expressions, which are converted into strings. For instance: println("x has value "x" and y has value "y); * There is now complete support for serialization: readObject, writeObject, readResolve and writeReplace methods can be written and be recognized by the serialization process. A custom serialVersionUID can be set for Nice classes using a final field: class X implements java.io.Serializable { final long serialVersionUID = 123456789L; } * Enums are serializable now and have a family() method that returns a list of all elements in that enum. * Reduced memory usage when doing multiple compilations in one jvm. * Added alternative syntax for patterns in method implementations. 'Type param' for 'param@Type' and '#Type param' for 'param#Type example usage: class Dummy { int x; equals(Dummy other) = this.x == other.x; } * Stricter typechecking of anonymous and local functions. * Reduced memory usage when repeatedly compiling in the same JVM (eclipse plugin, ant, testsuite, ...). * Bug fixes (accessing static fields of an superclass or interface, compilation of polymorphic tuples, captured 'this' in initializer, duplication of constructors in bytecode, disappearing contracts during recompilation, ... ) -- nice (0.9.4) * The compiler now knows that the statement 'assert false' never terminates. Therefore that statement can be used in a branch that is known to be unused, without needing to return a dummy value when the method does not return void. * Added source-level debugging information for recent debuggers (jsr 45). * Constraints on class type parameters can be written as a prefix of class declarations: <Bound T> class MyClass<T> { ... } This syntax is required when Bound is an abstract interface. * Generate more efficient code for anonymous functions that do not capture the environment. This also avoids a memory leak. * Retypings of classes and methods that can't be found by the compiler only generate a warning now. This makes it possible to add JDK 1.4 specific retypings without failing when compiling with an older JDK. * Bug fixes (error reporting for certain overloading by expected type, recompilation of overloaded methods with the same bytecode types). -- Thu, 20 Nov 2003 00:18:02 +0100 nice (0.9.3) * Improved type inference by instanceof tests. * Added multi line string literals. String that start and end with """ may take multiple lines and will include the line breaks. * Existing interfaces can (like classes) implement abstract interfaces: interface packagename.SomeInterface implements AbstractInterface; * Bugfixes (various pretty printing issues, type hole in instanceof inference, calls to abstract methods, chained assignments with arrays like 'x = arr[y] = z;', error messages of integer dispatch, reachability of labeled breaks, ...) -- Sat, 18 Oct 2003 12:01:50 +0200 nice (0.9.2) * Removed the concept of function. Now everything is a method, which is more flexible. The syntax that used to define a function is still valid: it now declares a method together with a default implementation. Exemple: class A { // Declares a method f, with a default implementation that returns 1. int f() = 1; } class B extends A { // Override f for B: // When called with an argument of type B, f returns 2. f() = 2; } The same applies for methods outside classes. * More dynamic type inference implemented. The type of a local variable is made more precise after a succesful instanceof: A a = ...; if (a instanceof B) // Here a has type B * Classes that implement java.lang.Cloneable now automatically support the clone method. * The deprecated 'main(args) { ... }' syntax for the main function is not supported anymore. Please use instead: 'void main(String[] args) { ... }' * Floating point literals are now of type double by default, adding 'f' or 'F' at the end will make them of type float. * Method parameters that are not dispatched on simply get their declared type. This avoids some type errors, and simplifies error messages. * Some more methods are added to nice.lang. * Implemented simple range expressions. 'a..b' is an immutable list of int's from a to b (inclusive) where b >= a. Example usage: for (i : 1..10) println(i); * In local variable declarations like 'var x = exp', the inferred type for x is int when 'exp' is of type byte or short. This will avoid unexpected behaviour in some cases. * Bugfixes (incrementation of byte local variables, require a default value for global variables, ...) -- Sat, 13 Sep 2003 02:40:46 +0200 nice (0.9.1) * Final fields can be overriden in sub-classes with a more precise type and a different default value. In particular, this removes the need for a cast when reading the field's value from an instance of the sub-class. class A { final List<String> names; } class B extends A { override LinkedList<String> names; } This is only possible for final fields for type safety reasons. * A class can now have initializers, which are executed each time an instance is created. class A { // Initializer { // Initialization code goes here. } } * Package-level constants and variables are now automatically initialized in the correct order when they directly depend on each other. * The type declaration in the enhanced for loop is now optional but only if the type is inferable. int[] array = [1,2,3,4,5]; for (elem : array) println(elem); * The compiler now warns about non-existing sourcepath entries. * Bugfixes (parameter's default value refering to previous parameters, ...) -- Sat, 9 Aug 2003 23:19:41 +0200 nice (0.9.0) * Implemented dispatch by integer comparison. An example: int abs(int n); abs(n>=0) = n; abs(n<0) = -n; The compiler knows that method abs is covered for all int values. It's also possible to compare with global constants: let int bar = 5; String foo(int n); foo(n<bar) = "smaller than bar"; foo(bar) = "equal to bar"; foo(n>bar) = "larger than bar"; * Added dispatch on String literals. This can be used as a switch on Strings. void foo(String color); foo("blue") { ... } foo("red") { ... } foo(color) { println("unknown color: " + color); } * Added dispatch on global constants whose value is a literal. Example: let int specialValue = 7; void foo(int n); foo(n) { /*do something*/ } foo(specialValue) { /*do something else*/ } * Dispatch on global constants works also for unique references(new objects). class Color {} let Color Red = new Color(); let Color Blue = new Color(); String name(Color color); name(color) = "unknown color"; name(Red) = "red"; name(Blue) = "blue"; * Implemented simple enums. The above color example can be simplified to: enum Color { Red, Blue, Green } String name(Color); name(Red) = "red"; name(Blue) = "blue"; name(Green) = "green"; The compiler knows now that the method "name" is completely covered. * The names of the arguments of a default implementation of a method must be the same as the names in the declaration. void foo(int number); foo(number) { ... } //correct //foo(num) { ... } //not valid This is important, so that a typo in a global constant or enum name in a method implementation does not lead to a default implementation. * Added operator ** to calculate powers of longs, doubles and BigIntegers. * The 'char' type is no longer a subtype of int. The integer unicode representation of a character c can be obtained by int(c). * Interfaces can now implement (finally or not) abstract interfaces. * 'true' and 'false' are now keywords, and better code is generated for them. The termination properties of loops with literal boolean values are now recognized, as in Java. * Redefining of local variables in their scope is not allowed anymore. * Method bodies with a single statement can be written without brackets. example: void foo() = throw new Exception(); * It is possible to bind the values of tuple arguments to functions: String foo((String s, String t)) = s + t; It also works for anonymous functions: List<(String, int)> tuples = new ArrayList(); tuples.add(("abc", 1)); tuples.foreach(((String name, int number)) => println("name: "+name+" number: "+number) ); * Archives (generated with the -a option) can now be used to distribute Nice libraries. * In the bytecode, two versions of the instance constructors are created: one which lists all the fields, the other one that lists only those without default value. This is useful when instantiating Nice classes from Java source or by reflexion, especially if a no-arg constructor is required for some reason. * Bugfixes (Parsing of nested tuples, global constants of type char, overloading resolution of method implementations with additional tc's, ...) * Improved some error messages. -- Fri, 18 Jul 2003 01:40:25 +0200 nice (0.8) * Stable version, based on 0.7.9 * Added operators to compute with java.math.BigInteger (+,-,*,/,%,...). * In functional types, '()' is always equivalent to 'void'. Ex: int->() * Anonymous functions that never return normally can be used with any return type. * Bugfixes (some cases of optional parameters, allowing arbitrarily nested tuples on the left side of an assignment, recursion for local functions, allow method parameter's default values to refer to 'this' when the method is declared inside a class, declaration of multiple local variables, nested type parameters in method declarations, improved some error messages, resolving overloading between fields and global variables, implemented nullness inference for local constants). -- Wed, 14 May 2003 16:30:15 +0200 nice (0.7.9) * Allow implementations of methods declared in Java to dispatch on all their arguments. So now we can at last write: class A { int x; equals(that@A) = this.x == that.x; } * In a method implementation, binding the type parameters should now be done in front: <T> T foo(T); <T> foo(x@String) { T res = x; ... } It is also possible to bind the runtime class of a parameter, by adding ": name" at the end of the pattern. This is needed in some cases: <Collection C, T, U> C<U> bar(C<T>, T->U); bar(x, f) { ... } <C,T,U> bar(l@List : L, f) // L is the runtime class of l. { L<U> res = similarEmptyCollection(l); res.add(f(l[0])); // Now we use the fact the res is a list. // Therefore, it would be impossible to declare its type as C<U>. res.add(res[0]); // By returning res, we need the fact that it is a subtype of C<U>, // so we could not declare its type as List<U>. return res; } * Changed the syntax for local variables. The "final" keyword is deprecated now for local variables, use "let" instead. In addition to the standard "type name = ..." syntax two new forms are allowed: let [ type ] name [ = expression ] ; var [ type ] name [ = expression ] ; At least a type or a default value are required. The type can only be left away when the compiler is able to interfere the type which is not always possible. A non function example to show some aspects the new syntax: let int[] arr = [1,2,3,4]; // here type interference doesn't work. List<int> list = new ArrayList(); list.addAll(arr); for(let iter = list.iterator(); iter.hasNext();) { let String s; var i = iter.next(); if (i % 2 == 0) { s = "even"; } else { s = "odd"; } println(i.toString()+" is "+s); } * Added global constants similar to the global variables, the syntax is: let type name = somexpression ; * Integer values can used as arrays of bits, as in if (x[index]) ... x[index] = true; * Compilation does not fail anymore if some classes on the classpath have an invalid bytecode format. * Improved error messages for possibly null values in assignments (Daniel), and for incorrect calls to constructors (Bryn Keller). * Bugfix (overloaded symbols used inside && or || expressions, ...). -- Sat, 19 Apr 2003 10:40:02 +0200 nice (0.7.8) * Some error messages are more usefull. * All operators are inlined and some operators (&&, ||, ! and comparisons) and if-statements generate better bytecode now. * Improved bytecode generation of pre/post-condition. * Implemented the enhanced for loop (similar to java 1.5 proposal). The loop works on arrays and collections, example: int[] arr = [1,2,3,4,5]; for (int i : arr) print(i); * Improved handling of nullness tests, as in: x != null && x.dereference() and x == null || x.dereference() * Allow functions returning a value to be used as arguments where functions returning void are expected. * Allow ?(T[]) syntax for optional arrays, as an alternative to T[?]. * Allow // comments at the end of a file, without a trailing newline. Also report more nicely /* comments that are not closed. * Allow nested tuples on the left side of a tuple assignment: (String a, (String b, String c)) = ("a", ("b", "c")); * Bugfixes (solved problems with case insentive filenames, ...). -- Tue, 8 Apr 2003 21:03:43 +0200 nice (0.7.7) * Methods taking a boolean parameter can now dispatch on the cases 'true' and 'false': boolean not(boolean); not(true) = false; not(false) = true; * Method can also dispatch on integer and character literals, but there is always a default case required. An example: long fac(long n); fac(n@0) = 1; fac(n@long) = n*fac(n-1); Another example using the shorter syntax: int fib(int n); fib(1) = 1; fib(2) = 1; fib(n) = fib(n-2) + fib(n-1); * The '@' in '@null' patterns is deprecated, '@' should be omitted. * The 'fun' keyword for anonymous functions is deprecated. It can be omitted. * New policy for typing calls to Java methods. By default, the typing is more convenient, considering arguments as possibly null, and results as non-null. The '--strict' compiler option enforces a stricter heuristic. Additionally, arrays are always considered to have non-null component types. Final fields are considered non-null. * Static native methods are not (wrongly) imported in the global name space anymore. One can just use them as in Java, by prefixing with the class name: String s = Integer.toHexString(100); It's now also possible to refer to static methods as anonymous functions: String[] s = integerArray.map(Integer.toHexString); * Allow the ?(T->U) syntax for optional functional types as an alternative to T ?-> U, and void -> Type as an alternative to () -> Type. * Added the 'concat' function on arrays, and sort function for lists. * Faster compilation for large projects with many classes. * Bugfixes (anonymous functions inside functionals with constracts, typechecking loop tests, other fixes to reduce the difference between what the parser accepts and the compiler can handle, ...). -- Wed, 5 Mar 2003 13:30:30 +0100 nice (0.7.6) * Implemented optional parameters' default value refering to previous parameters, like 'to' in the following example: <T> T[] slice(T[] array, int from = 0, int to = array.length - 1); * Added syntax for multiple comparisons (thanks to Arjan Boeijink): if (0 < i < N) ... * Fixed several issues with generic collections. In particular, for List<int> there was an ambiguity between remove(int) and remove(T) (since T=int). Therefore we renamed remove(int) into removeAt(int). * Added float(_) and char(_) primitives for value conversion. * Allows anonymous functions to be made of one statement without braces: (char c => if (Character.isLetter(c)) wordBuffer.append(c)) (char c => assert c != 'Z') * Method type parameters can be constrained to be non null by prefixing with the ! character, just like class type parameters. * 'this' can now be left implicit even in implementations of methods declared externally to a class. * Parser support for public-read and private-write fields (experimental). * Performance improvement for anonymous functions and for polymorphic usage of arrays. * Improved references to source lines in the bytecode (stack traces). * Bugfixes (using anonymous functions while overriding native methods, automatic array conversions in polymorphic code, nested literal primitive arrays, mutually dependant packages, ...). * For convenience of command-line tools (shells) with automatic completion, we allow a directory name instead of the corresponding package name. That is, we replace '/' (which is illegal in package names) by '.'. It is therefore possible to type 'nicec my/package/'. -- Tue, 21 Jan 2003 17:20:36 +0100 nice (0.7.5) * Addition of design by contract: assertions, pre- and post-conditions. * A class type parameter can now be constrained to be a non-option type, by prefixing it with the ! character: class Elem<!A> { ... } * Addition of the || operator on optional values: e1 || e2 evalues e1 and returns its value if it is not null (without evaluating e2). If e1 evaluates to null it returns the value of e2. It is equivalent to e1 != null ? e1 : e2, except e1 is not evaluated twice. This operator is handy to sequence expression to produce a value: find(n@Node, elem) = find(n.left, elem) || find(n.right, elem); * New numeric narrowing functions: int(x), short(x) and byte(x), equivalent to Java's (int), (short) and (byte). * Short anonymous functions made of one assignment now return void. Allows: [1,2,3].foreach(int j => i += j); instead of [1,2,3].foreach(int j => { i += j; }); * Arrays created with 0 elements have a non-option component type: String[] s0 = new String[0]; ?String[] s1 = new String[1]; They can still be used with option component type: ?String[] s0 = new String[0]; * Changed suffix notation for multiple-dimension array types, to match initialization. Dimensions are listed in order, instead of reverse order. For instance, String[][?] is the type of a non-null array of optional arrays of strings. * Changed typing for creation of arrays with multiple dimensions. The dimensions that are not initialized are given an option type: String[][?] s = new String[1][]; This accounts for the fact that s[0] == null, thus ensuring type safety. * Forbade @null patterns for method arguments that cannot be null. * Report duplicate implementations of a method with the same patterns. * Bugfixes (compilation of tuples with primitive types using subtyping, closures, returning a value inside try/finally or synchronized, ...). * Fixed the nicec script on Max OS X, when gcj is not present. -- Wed, 20 Nov 2002 13:32:55 +0100 nice (0.7.4) * Added support for Generic Java types. This allows in particular to use java.util.* collections with parameterized types (e.g. List<String>). These replace the previous (very partial) collections from nice.lang. Functionals on collections (foreach, map, has, ...) are applicable to java.util Collections. * Allow class type parameters to be constrained: class MyClass<Bound P> { ...} This allow MyClass to be instantiated only on subtypes of Bound in the constructor and the class methods. * Fixed error message for calling new on an interface or Java abstract class, and when a class or interface (indirectly) implements itself. * Allow the <T> syntax to introduce type variables, in addition to <Any T> (that is, any is optional). This is consistent with GJ, and the syntax for class type parameters. * Improved overloading resolution when used on functions with optional arguments. * Removed the old syntax <T1, T2> for tuples. Use (T1, T2) instead. * Bugfixes (forward reference to constructor in field initializer, anonymous functions in field initializer, override of void native method, tuples, ...). -- Tue, 1 Oct 2002 14:51:21 +0200 nice (0.7.3) * Allow subclasses of Java classes to call any of the super-constructors, not just the no-arg one. The arguments of the super-constructor used are just the first, not-named arguments of the automatic constructor. * The 'main(args) { ... }' syntax for the main function is deprecated. Please use instead: 'void main(String[] args) { ... }' * Improved compilation speed, especially for programs using many classes (up to 2x faster). * Fixed implicit access to fields of the current class in ambiguous situations, and when overriding native methods. * Other fixes (issue with recompilation of up-to-date packages, ...) -- Wed, 4 Sep 2002 08:04:47 +0200 nice (0.7.2) * Implemented synchronized statements. * Implemented bitwise complement and "get bit" on long integers. * Allow Nice classes and interfaces to implement and extend java interfaces without pretending they are classes. * Allow to declare that existing classes implement new abstract interfaces. -- Fri, 23 Aug 2002 12:51:21 +0200 nice (0.7.1) * Fields can be accessed without specifying "this". * The default syntax for tuple types is now (T1, ..., Tn) * Made "instanceof" work with classes defined in the same package. * Enhanced error message for invalid calls to anonymous functions. * Correctly infer the return type of all anonymous functions. * Generate better code when using anonymous functions. * Bugfixes (break statement, anonymous functions used in global variables inside complex expressions, polymorphic arrays used across packages, super, ...). -- Fri, 2 Aug 2002 09:29:19 +0200 nice (0.7.0) * Added the possibility to call "super" from a method implementation. * Added support for transient and volatile fields. -- Tue, 16 Jul 2002 12:59:47 +0200 nice (0.6) * First stable version, based on 0.5.6 * Fixed an error message for incorrect calls to anonymous functions. -- Thu, 11 Jul 2002 10:52:52 +0200 nice (0.5.6) * Added the ".class" construct. * Completed the "instanceof" construct. * Calling new T[size] where T is a type variable now correctly returns an array with optional element type. It can be filled with non-null values using the 'fill' function, e.g. fill(new T[size], int i => f(x[i])) -- Sat, 6 Jul 2002 12:44:51 +0200 nice (0.5.5) * Merged --classpath and --packagepath options into --classpath. This is simpler, and the behaviour is more logical. * The compiler is now reentrant. This should not make any difference when running from the command-line, but this is important to allow tools written in Java or Nice (like the Ant task, the testsuite, an IDE) to call the compiler repetively, without starting a new JVM. * Fixed several bugs (export of optional functional types, ...). -- Fri, 21 Jun 2002 09:18:20 +0200 nice (0.5.4) * Added short syntax for anonymous functions: int i => i+1 /* function of one argument */ (int i, int j) => i+j /* function of several arguments */ * Renamed `iter` to `foreach`. `iter` is still accepted, but will probably be removed sometime in the future. Together with the syntax change for anonymous functions, this gives a nice and user-friendly syntax for iterations: names.foreach(String name => println(name)); * Anonymous function cannot appear where a statement is expected (some expressions can). This is good since an anonymous function which is not called cannot have side-effects, and therefore this case was meaningless and probably buggy. * Fixed inference for possibly null variables in some complex cases. * Other bugfixes (valid error message when trying to implement a function). -- Daniel Bonniot <daniel@blanche> Thu, 13 Jun 2002 16:30:27 +0200 nice (0.5.3) * Testing a variable against null in a while or for loop condition now allows to use it as non-null, until is it assigned a possibly null value. * Added many mathematical functions (sin, cos, round, max, min, ...). This makes it unnecessary to prefix them with (java.lang.)Math. * It is now possible to use "." (current directory) in the --classpath argument (this needed a workaround for a probable bug in Sun's URLClassLoader, at least in 1.3). * Other bugfixes (creating arrays of "exotic" types, using arrays in field initializers). -- Thu, 30 May 2002 12:57:46 +0200 nice (0.5.2) * Calls to constructors now require using the fields' names. * Produce a meaningful message when a field is used without using an object to load it from. * Fixed parsing problem with (x.f)(e) as a statement. * Allow classpath to be set for external java classes without requiring to include Nice's bootstrap classes. * Functions are generated in a class "<packagename>.fun", so that they can be called from code written in Java. -- Tue, 7 May 2002 15:23:53 +0200 nice (0.5.1) * Constructors now take the initial values of the object's fields as named arguments. A field declaration (inside a class declaration) now accepts an optional value after "=" (like in Java). This value is used as the default if the field is not mentioned in a call to the constructor. A field with no default value must be mentioned in every call to the constructor. * Compile properly functions declared inside abstract interfaces. * Allow optional parameters to be used across modules. -- Mon, 29 Apr 2002 19:07:24 +0200 nice (0.5) * Recognise the standard arrow notation for functional types int->int (int,int)->int (int->int)->int The old notation fun(int)(int) is deprecated and will be removed before version 1.0 * Assigning a possibly null value to a variable of non-null type now produces an error instead of a warning. * Fixes bug that considered that int a = 10, b; initializes both a and b to 10. * Fixed variable initialization analysis for do-while loops. * Make the compiler compatible with JDK 1.4 * Fixed bug on MS-Windows with archive creation because of the case-insensivity of the file system. * Fixed creation of archive from up-to-date packages stored in jar. * Accept anonymous functions that do nothing. * Editor (emacs) mode is now driven by command-line instead of inspecting the EMACS environment variable. This works around a bug in emacs 21.2.1 and might be more portable. Also makes it easier to write a nice-mode for other editors without changing the existing code or script. -- Thu, 18 Apr 2002 14:44:13 +0200 nice (0.0.020405) * Accepts constants: final String s1 = "Java style"; final s3 = "The type of constants can be omitted"; * More compatibility with Java: - checks that all statements are reachable - checks that local variables are assigned before use - classes can be declared public or private - ... More than half of the Jacks (java compiler testsuite) tests now pass! Most failures come from the difference in the syntax of method declaration. * Arrays of void values are forbidden. They most probably originate from a bug in the source program. * Better handling of inhomogenous tuples with native types (e.g. <int, long>) * Better wrapping/unwrapping code for arrays used as Collections. * Bugfixes for some polymorphic operations on arrays. * Bugfixed the bitshift operators >>, >>> and <<. -- Fri, 5 Apr 2002 13:01:17 +0200 nice (0.0.020226) * Fixed bug that prevented using "this" in overriden native methods. * Better error messages for method calls with wrong number of arguments. * Accept methods with no implementation when their domain is empty. * Abstract interfaces are fully qualified just like classes and correctly list their super-interfaces in the package interface. This really makes it possible to use them across packages. * Various other bugfixes. -- Tue, 26 Feb 2002 16:06:00 +0100 nice (0.0.020205) * Allow multiple variables to be defined together, as in: int x = 1, y; * Allow variable declaration in tuple affectation: (int x, int y) = f(0); * Added 'break' and 'continue' statements. * Implemented 'do' loops. * Allow overriding of native java methods. It is now possible to define a subclass of a java class or interface and override the methods. * Changed compilation scheme for method alternatives. This results in shorter class files and more intuitive stack traces. -- Tue, 5 Feb 2002 13:15:03 +0100 nice (0.0.020105) * Allowed to change the type of native class fields. This allows in particular to use System.out.println() and such again. * Fixed type of if expressions in the presence of non-nullness inference. -- Sat, 5 Jan 2002 14:50:37 +0100 nice (0.0.020102) * Made nicec smart about when a local variable might be null. * Added the 'instanceof' and '~' (bitwise complement) keywords. * Do not stop at the first syntax or type error in more situations. * Ehanced error messages. * Emacs mode: allow to interactively set the compiler's location (the string variable 'nice-program'). -- Wed, 2 Jan 2002 20:31:31 +0100 nice (0.0.011219) * Initial Release. -- Tue, 18 Dec 2001 23:23:32 +0100 Index: Makefile =================================================================== RCS file: /cvsroot/nice/Nice/Makefile,v retrieving revision 1.131 retrieving revision 1.132 diff -C2 -d -r1.131 -r1.132 *** Makefile 12 Nov 2003 18:01:54 -0000 1.131 --- Makefile 30 Nov 2003 11:22:28 -0000 1.132 *************** *** 7,13 **** LISPDIR=${PREFIX}/share/emacs/site-lisp/nice ! # Get the version from the debian changelog. ! VERSION = ${shell expr "`head -1 debian/changelog`" : '.*(\(.*\))'} ! TAG = ${shell if [ `grep '^ --' debian/changelog |head -1|wc -c` -le 10 ]; then echo prerelease; fi } # ANT classpath; we will use NICE_ANTJAR or ANT_HOME (in that order) --- 7,13 ---- LISPDIR=${PREFIX}/share/emacs/site-lisp/nice ! # Get the version from the NEWS file. ! VERSION = ${shell expr "`head -1 NEWS`" : '.*(\(.*\))'} ! TAG = ${shell if [ `grep '^ --' NEWS |head -1|wc -c` -le 10 ]; then echo prerelease; fi } # ANT classpath; we will use NICE_ANTJAR or ANT_HOME (in that order) |
From: <bo...@us...> - 2003-11-30 11:22:31
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1:/tmp/cvs-serv24988/debian Modified Files: rules changelog Log Message: Changes between versions should not go in the NEWS file, while debian/changelog is reserved for Debian-specific changes. Index: rules =================================================================== RCS file: /cvsroot/nice/Nice/debian/rules,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** rules 19 Nov 2003 01:18:26 -0000 1.7 --- rules 30 Nov 2003 11:22:27 -0000 1.8 *************** *** 66,70 **** dh_installman dh_installinfo ! dh_installchangelogs dh_link # dh_strip --- 66,70 ---- dh_installman dh_installinfo ! dh_installchangelogs NEWS dh_link # dh_strip Index: changelog =================================================================== RCS file: /cvsroot/nice/Nice/debian/changelog,v retrieving revision 1.233 retrieving revision 1.234 diff -C2 -d -r1.233 -r1.234 *** changelog 28 Nov 2003 17:44:14 -0000 1.233 --- changelog 30 Nov 2003 11:22:27 -0000 1.234 *************** *** 1,698 **** ! nice (0.9.5) unstable; urgency=low ! ! * String concatenation can be performed by mere juxtaposition of string ! literals and simple expressions, which are converted into strings. For ! instance: ! println("x has value "x" and y has value "y); ! * There is now complete support for serialization: ! readObject, writeObject, readResolve and writeReplace methods can be ! written and be recognized by the serialization process. ! A custom serialVersionUID can be set for Nice classes using a final field: ! class X implements java.io.Serializable { ! final long serialVersionUID = 123456789L; ! } ! * Enums are serializable now and have a family() method that returns a list ! of all elements in that enum. ! * Reduced memory usage when doing multiple compilations in one jvm. ! * Added alternative syntax for patterns in method implementations. ! 'Type param' for 'param@Type' and '#Type param' for 'param#Type ! example usage: ! class Dummy { ! int x; ! equals(Dummy other) = this.x == other.x; ! } ! * Stricter typechecking of anonymous and local functions. ! * Reduced memory usage when repeatedly compiling in the same JVM (eclipse ! plugin, ant, testsuite, ...). ! * Bug fixes (accessing static fields of an superclass or interface, ! compilation of polymorphic tuples, captured 'this' in initializer, ! duplication of constructors in bytecode, disappearing contracts during ! recompilation, ... ) ! ! -- ! ! nice (0.9.4) unstable; urgency=low ! ! * The compiler now knows that the statement 'assert false' never terminates. ! Therefore that statement can be used in a branch that is known to be ! unused, without needing to return a dummy value when the method does not ! return void. ! * Added source-level debugging information for recent debuggers (jsr 45). ! * Constraints on class type parameters can be written as a prefix of ! class declarations: ! <Bound T> class MyClass<T> { ... } ! This syntax is required when Bound is an abstract interface. ! * Generate more efficient code for anonymous functions that do not capture ! the environment. This also avoids a memory leak. ! * Retypings of classes and methods that can't be found by the compiler only ! generate a warning now. This makes it possible to add JDK 1.4 specific ! retypings without failing when compiling with an older JDK. ! * Bug fixes (error reporting for certain overloading by expected type, ! recompilation of overloaded methods with the same bytecode types). ! ! -- Daniel Bonniot <bo...@us...> Thu, 20 Nov 2003 00:18:02 +0100 ! ! nice (0.9.3) unstable; urgency=low ! ! * Improved type inference by instanceof tests. ! * Added multi line string literals. String that start and end with """ ! may take multiple lines and will include the line breaks. ! * Existing interfaces can (like classes) implement abstract interfaces: ! interface packagename.SomeInterface implements AbstractInterface; ! * Bugfixes (various pretty printing issues, type hole in instanceof ! inference, calls to abstract methods, chained assignments with arrays like ! 'x = arr[y] = z;', error messages of integer dispatch, reachability of ! labeled breaks, ...) ! ! -- Daniel Bonniot <bo...@us...> Sat, 18 Oct 2003 12:01:50 +0200 ! ! nice (0.9.2) unstable; urgency=low ! ! * Removed the concept of function. Now everything is a method, which is more ! flexible. ! The syntax that used to define a function is still valid: it now ! declares a method together with a default implementation. Exemple: ! class A { ! // Declares a method f, with a default implementation that returns 1. ! int f() = 1; ! } ! ! class B extends A { ! // Override f for B: ! // When called with an argument of type B, f returns 2. ! f() = 2; ! } ! The same applies for methods outside classes. ! * More dynamic type inference implemented. The type of a local variable is ! made more precise after a succesful instanceof: ! A a = ...; ! if (a instanceof B) ! // Here a has type B ! * Classes that implement java.lang.Cloneable now automatically support ! the clone method. ! * The deprecated 'main(args) { ... }' syntax for the main function is not ! supported anymore. Please use instead: 'void main(String[] args) { ... }' ! * Floating point literals are now of type double by default, adding ! 'f' or 'F' at the end will make them of type float. ! * Method parameters that are not dispatched on simply get their declared ! type. This avoids some type errors, and simplifies error messages. ! * Some more methods are added to nice.lang. ! * Implemented simple range expressions. 'a..b' is an immutable list of int's ! from a to b (inclusive) where b >= a. Example usage: ! for (i : 1..10) println(i); ! * In local variable declarations like 'var x = exp', the inferred type ! for x is int when 'exp' is of type byte or short. This will avoid ! unexpected behaviour in some cases. ! * Bugfixes (incrementation of byte local variables, require a default value ! for global variables, ...) ! ! -- Daniel Bonniot <bo...@us...> Sat, 13 Sep 2003 02:40:46 +0200 ! ! nice (0.9.1) unstable; urgency=low ! ! * Final fields can be overriden in sub-classes with a more precise type ! and a different default value. In particular, this removes the need for ! a cast when reading the field's value from an instance of the sub-class. ! class A ! { ! final List<String> names; ! } ! class B extends A ! { ! override LinkedList<String> names; ! } ! This is only possible for final fields for type safety reasons. ! * A class can now have initializers, which are executed each time an instance ! is created. ! class A ! { ! // Initializer ! { ! // Initialization code goes here. ! } ! } ! * Package-level constants and variables are now automatically initialized ! in the correct order when they directly depend on each other. ! * The type declaration in the enhanced for loop is now optional but only if ! the type is inferable. ! int[] array = [1,2,3,4,5]; ! for (elem : array) println(elem); ! * The compiler now warns about non-existing sourcepath entries. ! * Bugfixes (parameter's default value refering to previous parameters, ...) ! ! -- Daniel Bonniot <bo...@us...> Sat, 9 Aug 2003 23:19:41 +0200 ! ! nice (0.9.0) unstable; urgency=low ! ! * Implemented dispatch by integer comparison. An example: ! int abs(int n); ! abs(n>=0) = n; ! abs(n<0) = -n; ! The compiler knows that method abs is covered for all int values. ! It's also possible to compare with global constants: ! let int bar = 5; ! String foo(int n); ! foo(n<bar) = "smaller than bar"; ! foo(bar) = "equal to bar"; ! foo(n>bar) = "larger than bar"; ! * Added dispatch on String literals. This can be used as a switch on Strings. ! void foo(String color); ! foo("blue") { ... } ! foo("red") { ... } ! foo(color) { println("unknown color: " + color); } ! * Added dispatch on global constants whose value is a literal. Example: ! let int specialValue = 7; ! void foo(int n); ! foo(n) { /*do something*/ } ! foo(specialValue) { /*do something else*/ } ! * Dispatch on global constants works also for unique references(new objects). ! class Color {} ! let Color Red = new Color(); ! let Color Blue = new Color(); ! String name(Color color); ! name(color) = "unknown color"; ! name(Red) = "red"; ! name(Blue) = "blue"; ! * Implemented simple enums. The above color example can be simplified to: ! enum Color { Red, Blue, Green } ! String name(Color); ! name(Red) = "red"; ! name(Blue) = "blue"; ! name(Green) = "green"; ! The compiler knows now that the method "name" is completely covered. ! * The names of the arguments of a default implementation of a method must ! be the same as the names in the declaration. ! void foo(int number); ! foo(number) { ... } //correct ! //foo(num) { ... } //not valid ! This is important, so that a typo in a global constant or enum name ! in a method implementation does not lead to a default implementation. ! * Added operator ** to calculate powers of longs, doubles and BigIntegers. ! * The 'char' type is no longer a subtype of int. The integer unicode ! representation of a character c can be obtained by int(c). ! * Interfaces can now implement (finally or not) abstract interfaces. ! * 'true' and 'false' are now keywords, and better code is generated for them. ! The termination properties of loops with literal boolean values are now ! recognized, as in Java. ! * Redefining of local variables in their scope is not allowed anymore. ! * Method bodies with a single statement can be written without brackets. ! example: void foo() = throw new Exception(); ! * It is possible to bind the values of tuple arguments to functions: ! String foo((String s, String t)) = s + t; ! It also works for anonymous functions: ! List<(String, int)> tuples = new ArrayList(); ! tuples.add(("abc", 1)); ! tuples.foreach(((String name, int number)) => ! println("name: "+name+" number: "+number) ); ! * Archives (generated with the -a option) can now be used to distribute ! Nice libraries. ! * In the bytecode, two versions of the instance constructors are created: ! one which lists all the fields, the other one that lists only those ! without default value. This is useful when instantiating Nice classes ! from Java source or by reflexion, especially if a no-arg constructor is ! required for some reason. ! * Bugfixes (Parsing of nested tuples, global constants of type char, ! overloading resolution of method implementations with additional tc's, ...) ! * Improved some error messages. ! ! -- Daniel Bonniot <bo...@us...> Fri, 18 Jul 2003 01:40:25 +0200 ! ! nice (0.8) unstable; urgency=low ! ! * Stable version, based on 0.7.9 ! * Added operators to compute with java.math.BigInteger (+,-,*,/,%,...). ! * In functional types, '()' is always equivalent to 'void'. Ex: int->() ! * Anonymous functions that never return normally can be used with any ! return type. ! * Bugfixes (some cases of optional parameters, allowing arbitrarily nested ! tuples on the left side of an assignment, recursion for local functions, ! allow method parameter's default values to refer to 'this' when the method ! is declared inside a class, declaration of multiple local variables, ! nested type parameters in method declarations, improved some error messages, ! resolving overloading between fields and global variables, implemented ! nullness inference for local constants). ! ! -- Daniel Bonniot <bo...@us...> Wed, 14 May 2003 16:30:15 +0200 ! ! nice (0.7.9) unstable; urgency=low ! ! * Allow implementations of methods declared in Java to dispatch on ! all their arguments. So now we can at last write: ! class A { ! int x; ! equals(that@A) = this.x == that.x; ! } ! * In a method implementation, binding the type parameters should now ! be done in front: ! <T> T foo(T); ! <T> foo(x@String) { T res = x; ... } ! It is also possible to bind the runtime class of a parameter, by adding ! ": name" at the end of the pattern. This is needed in some cases: ! <Collection C, T, U> C<U> bar(C<T>, T->U); ! bar(x, f) { ... } ! <C,T,U> bar(l@List : L, f) // L is the runtime class of l. ! { ! L<U> res = similarEmptyCollection(l); ! res.add(f(l[0])); ! ! // Now we use the fact the res is a list. ! // Therefore, it would be impossible to declare its type as C<U>. ! res.add(res[0]); ! ! // By returning res, we need the fact that it is a subtype of C<U>, ! // so we could not declare its type as List<U>. ! return res; ! } ! * Changed the syntax for local variables. The "final" keyword is deprecated ! now for local variables, use "let" instead. In addition to the standard ! "type name = ..." syntax two new forms are allowed: ! let [ type ] name [ = expression ] ; ! var [ type ] name [ = expression ] ; ! At least a type or a default value are required. ! The type can only be left away when the compiler is able to interfere ! the type which is not always possible. ! A non function example to show some aspects the new syntax: ! let int[] arr = [1,2,3,4]; // here type interference doesn't work. ! List<int> list = new ArrayList(); ! list.addAll(arr); ! for(let iter = list.iterator(); iter.hasNext();) { ! let String s; ! var i = iter.next(); ! if (i % 2 == 0) { s = "even"; } ! else { s = "odd"; } ! println(i.toString()+" is "+s); ! } ! * Added global constants similar to the global variables, the syntax is: ! let type name = somexpression ; ! * Integer values can used as arrays of bits, as in ! if (x[index]) ... ! x[index] = true; ! * Compilation does not fail anymore if some classes on the classpath ! have an invalid bytecode format. ! * Improved error messages for possibly null values in assignments (Daniel), ! and for incorrect calls to constructors (Bryn Keller). ! * Bugfix (overloaded symbols used inside && or || expressions, ...). ! ! -- Daniel Bonniot <bo...@us...> Sat, 19 Apr 2003 10:40:02 +0200 ! ! nice (0.7.8) unstable; urgency=low ! ! * Some error messages are more usefull. ! * All operators are inlined and some operators (&&, ||, ! and comparisons) ! and if-statements generate better bytecode now. ! * Improved bytecode generation of pre/post-condition. ! * Implemented the enhanced for loop (similar to java 1.5 proposal). ! The loop works on arrays and collections, example: ! int[] arr = [1,2,3,4,5]; ! for (int i : arr) print(i); ! * Improved handling of nullness tests, as in: ! x != null && x.dereference() ! and ! x == null || x.dereference() ! * Allow functions returning a value to be used as arguments where ! functions returning void are expected. ! * Allow ?(T[]) syntax for optional arrays, as an alternative to T[?]. ! * Allow // comments at the end of a file, without a trailing newline. ! Also report more nicely /* comments that are not closed. ! * Allow nested tuples on the left side of a tuple assignment: ! (String a, (String b, String c)) = ("a", ("b", "c")); ! * Bugfixes (solved problems with case insentive filenames, ...). ! ! -- Daniel Bonniot <bo...@us...> Tue, 8 Apr 2003 21:03:43 +0200 ! ! nice (0.7.7) unstable; urgency=low ! ! * Methods taking a boolean parameter can now dispatch on the cases ! 'true' and 'false': ! boolean not(boolean); ! not(true) = false; ! not(false) = true; ! * Method can also dispatch on integer and character literals, but there is ! always a default case required. An example: ! long fac(long n); ! fac(n@0) = 1; ! fac(n@long) = n*fac(n-1); ! Another example using the shorter syntax: ! int fib(int n); ! fib(1) = 1; ! fib(2) = 1; ! fib(n) = fib(n-2) + fib(n-1); ! * The '@' in '@null' patterns is deprecated, '@' should be omitted. ! * The 'fun' keyword for anonymous functions is deprecated. It can be omitted. ! * New policy for typing calls to Java methods. By default, the typing ! is more convenient, considering arguments as possibly null, and ! results as non-null. The '--strict' compiler option enforces a stricter ! heuristic. ! Additionally, arrays are always considered to have non-null component ! types. ! Final fields are considered non-null. ! * Static native methods are not (wrongly) imported in the global name space ! anymore. One can just use them as in Java, by prefixing with the class ! name: ! String s = Integer.toHexString(100); ! It's now also possible to refer to static methods as anonymous functions: ! String[] s = integerArray.map(Integer.toHexString); ! * Allow the ?(T->U) syntax for optional functional types as an alternative ! to T ?-> U, and void -> Type as an alternative to () -> Type. ! * Added the 'concat' function on arrays, and sort function for lists. ! * Faster compilation for large projects with many classes. ! * Bugfixes (anonymous functions inside functionals with constracts, ! typechecking loop tests, other fixes to reduce the difference between ! what the parser accepts and the compiler can handle, ...). ! ! -- Daniel Bonniot <bo...@us...> Wed, 5 Mar 2003 13:30:30 +0100 ! ! nice (0.7.6) unstable; urgency=low ! ! * Implemented optional parameters' default value refering to ! previous parameters, like 'to' in the following example: ! <T> T[] slice(T[] array, int from = 0, int to = array.length - 1); ! * Added syntax for multiple comparisons (thanks to Arjan Boeijink): ! if (0 < i < N) ... ! * Fixed several issues with generic collections. ! In particular, for List<int> there was an ambiguity between ! remove(int) and remove(T) (since T=int). ! Therefore we renamed remove(int) into removeAt(int). ! * Added float(_) and char(_) primitives for value conversion. ! * Allows anonymous functions to be made of one statement without braces: ! (char c => if (Character.isLetter(c)) wordBuffer.append(c)) ! (char c => assert c != 'Z') ! * Method type parameters can be constrained to be non null by prefixing ! with the ! character, just like class type parameters. ! * 'this' can now be left implicit even in implementations of methods ! declared externally to a class. ! * Parser support for public-read and private-write fields (experimental). ! * Performance improvement for anonymous functions and for polymorphic ! usage of arrays. ! * Improved references to source lines in the bytecode (stack traces). ! * Bugfixes (using anonymous functions while overriding native methods, ! automatic array conversions in polymorphic code, nested literal primitive ! arrays, mutually dependant packages, ...). ! * For convenience of command-line tools (shells) with automatic completion, ! we allow a directory name instead of the corresponding package name. ! That is, we replace '/' (which is illegal in package names) by '.'. ! It is therefore possible to type 'nicec my/package/'. ! ! -- Daniel Bonniot <bo...@us...> Tue, 21 Jan 2003 17:20:36 +0100 ! ! nice (0.7.5) unstable; urgency=low ! ! * Addition of design by contract: assertions, pre- and post-conditions. ! * A class type parameter can now be constrained to be a non-option type, ! by prefixing it with the ! character: ! class Elem<!A> { ... } ! * Addition of the || operator on optional values: ! e1 || e2 ! evalues e1 and returns its value if it is not null (without evaluating e2). ! If e1 evaluates to null it returns the value of e2. ! It is equivalent to e1 != null ? e1 : e2, except e1 is not evaluated twice. ! This operator is handy to sequence expression to produce a value: ! find(n@Node, elem) = find(n.left, elem) || find(n.right, elem); ! * New numeric narrowing functions: int(x), short(x) and byte(x), ! equivalent to Java's (int), (short) and (byte). ! * Short anonymous functions made of one assignment now return void. Allows: ! [1,2,3].foreach(int j => i += j); ! instead of ! [1,2,3].foreach(int j => { i += j; }); ! * Arrays created with 0 elements have a non-option component type: ! String[] s0 = new String[0]; ! ?String[] s1 = new String[1]; ! They can still be used with option component type: ! ?String[] s0 = new String[0]; ! * Changed suffix notation for multiple-dimension array types, to match ! initialization. Dimensions are listed in order, instead of reverse order. ! For instance, ! String[][?] ! is the type of a non-null array of optional arrays of strings. ! * Changed typing for creation of arrays with multiple dimensions. ! The dimensions that are not initialized are given an option type: ! String[][?] s = new String[1][]; ! This accounts for the fact that s[0] == null, thus ensuring type safety. ! * Forbade @null patterns for method arguments that cannot be null. ! * Report duplicate implementations of a method with the same patterns. ! * Bugfixes (compilation of tuples with primitive types using subtyping, ! closures, returning a value inside try/finally or synchronized, ...). ! * Fixed the nicec script on Max OS X, when gcj is not present. ! ! -- Daniel Bonniot <bo...@us...> Wed, 20 Nov 2002 13:32:55 +0100 ! ! nice (0.7.4) unstable; urgency=low ! ! * Added support for Generic Java types. This allows in particular to use ! java.util.* collections with parameterized types (e.g. List<String>). ! These replace the previous (very partial) collections from nice.lang. ! Functionals on collections (foreach, map, has, ...) are applicable ! to java.util Collections. ! * Allow class type parameters to be constrained: ! class MyClass<Bound P> { ...} ! This allow MyClass to be instantiated only on subtypes of Bound ! in the constructor and the class methods. ! * Fixed error message for calling new on an interface or Java abstract ! class, and when a class or interface (indirectly) implements itself. ! * Allow the <T> syntax to introduce type variables, in addition to ! <Any T> (that is, any is optional). This is consistent with GJ, ! and the syntax for class type parameters. ! * Improved overloading resolution when used on functions with optional ! arguments. ! * Removed the old syntax <T1, T2> for tuples. Use (T1, T2) instead. ! * Bugfixes (forward reference to constructor in field initializer, ! anonymous functions in field initializer, override of void native method, ! tuples, ...). ! ! -- Daniel Bonniot <bo...@us...> Tue, 1 Oct 2002 14:51:21 +0200 ! ! nice (0.7.3) unstable; urgency=low ! ! * Allow subclasses of Java classes to call any of the super-constructors, ! not just the no-arg one. The arguments of the super-constructor used are ! just the first, not-named arguments of the automatic constructor. ! * The 'main(args) { ... }' syntax for the main function is deprecated. ! Please use instead: 'void main(String[] args) { ... }' ! * Improved compilation speed, especially for programs using many classes ! (up to 2x faster). ! * Fixed implicit access to fields of the current class in ambiguous ! situations, and when overriding native methods. ! * Other fixes (issue with recompilation of up-to-date packages, ...) ! ! -- Daniel Bonniot <bo...@us...> Wed, 4 Sep 2002 08:04:47 +0200 ! ! nice (0.7.2) unstable; urgency=low ! ! * Implemented synchronized statements. ! * Implemented bitwise complement and "get bit" on long integers. ! * Allow Nice classes and interfaces to implement and extend java interfaces ! without pretending they are classes. ! * Allow to declare that existing classes implement new abstract interfaces. ! ! -- Daniel Bonniot <bo...@us...> Fri, 23 Aug 2002 12:51:21 +0200 ! ! nice (0.7.1) unstable; urgency=low ! ! * Fields can be accessed without specifying "this". ! * The default syntax for tuple types is now (T1, ..., Tn) ! * Made "instanceof" work with classes defined in the same package. ! * Enhanced error message for invalid calls to anonymous functions. ! * Correctly infer the return type of all anonymous functions. ! * Generate better code when using anonymous functions. ! * Bugfixes (break statement, anonymous functions used in global variables ! inside complex expressions, polymorphic arrays used ! across packages, super, ...). ! ! -- Daniel Bonniot <bo...@us...> Fri, 2 Aug 2002 09:29:19 +0200 ! ! nice (0.7.0) unstable; urgency=low ! ! * Added the possibility to call "super" from a method implementation. ! * Added support for transient and volatile fields. ! ! -- Daniel Bonniot <bo...@us...> Tue, 16 Jul 2002 12:59:47 +0200 ! ! nice (0.6) unstable; urgency=low ! ! * First stable version, based on 0.5.6 ! * Fixed an error message for incorrect calls to anonymous functions. ! ! -- Daniel Bonniot <bo...@us...> Thu, 11 Jul 2002 10:52:52 +0200 ! ! nice (0.5.6) unstable; urgency=low ! ! * Added the ".class" construct. ! * Completed the "instanceof" construct. ! * Calling new T[size] where T is a type variable now correctly returns ! an array with optional element type. It can be filled with non-null values ! using the 'fill' function, e.g. ! fill(new T[size], int i => f(x[i])) ! ! -- Daniel Bonniot <bo...@us...> Sat, 6 Jul 2002 12:44:51 +0200 ! ! nice (0.5.5) unstable; urgency=low ! ! * Merged --classpath and --packagepath options into --classpath. ! This is simpler, and the behaviour is more logical. ! * The compiler is now reentrant. This should not make any difference ! when running from the command-line, but this is important to allow ! tools written in Java or Nice (like the Ant task, the testsuite, ! an IDE) to call the compiler repetively, without starting a new JVM. ! * Fixed several bugs (export of optional functional types, ...). ! ! -- Daniel Bonniot <bo...@us...> Fri, 21 Jun 2002 09:18:20 +0200 ! ! nice (0.5.4) unstable; urgency=low ! ! * Added short syntax for anonymous functions: ! int i => i+1 /* function of one argument */ ! (int i, int j) => i+j /* function of several arguments */ ! * Renamed `iter` to `foreach`. `iter` is still accepted, ! but will probably be removed sometime in the future. ! Together with the syntax change for anonymous functions, ! this gives a nice and user-friendly syntax for iterations: ! ! names.foreach(String name => println(name)); ! ! * Anonymous function cannot appear where a statement is expected ! (some expressions can). This is good since an anonymous function which ! is not called cannot have side-effects, and therefore this case was ! meaningless and probably buggy. ! * Fixed inference for possibly null variables in some complex cases. ! * Other bugfixes (valid error message when trying to implement a function). ! ! -- Daniel Bonniot <daniel@blanche> Thu, 13 Jun 2002 16:30:27 +0200 ! ! nice (0.5.3) unstable; urgency=low ! ! * Testing a variable against null in a while or for loop condition now ! allows to use it as non-null, until is it assigned a possibly null value. ! * Added many mathematical functions (sin, cos, round, max, min, ...). ! This makes it unnecessary to prefix them with (java.lang.)Math. ! * It is now possible to use "." (current directory) in ! the --classpath argument (this needed a workaround for ! a probable bug in Sun's URLClassLoader, at least in 1.3). ! * Other bugfixes (creating arrays of "exotic" types, using arrays in field ! initializers). ! ! -- Daniel Bonniot <bo...@us...> Thu, 30 May 2002 12:57:46 +0200 ! ! nice (0.5.2) unstable; urgency=low ! ! * Calls to constructors now require using the fields' names. ! * Produce a meaningful message when a field is used without using ! an object to load it from. ! * Fixed parsing problem with (x.f)(e) as a statement. ! * Allow classpath to be set for external java classes without ! requiring to include Nice's bootstrap classes. ! * Functions are generated in a class "<packagename>.fun", so that ! they can be called from code written in Java. ! ! -- Daniel Bonniot <bo...@us...> Tue, 7 May 2002 15:23:53 +0200 ! ! nice (0.5.1) unstable; urgency=low ! ! * Constructors now take the initial values of the object's fields as ! named arguments. A field declaration (inside a class declaration) ! now accepts an optional value after "=" (like in Java). This value ! is used as the default if the field is not mentioned in a call to ! the constructor. A field with no default value must be mentioned ! in every call to the constructor. ! * Compile properly functions declared inside abstract interfaces. ! * Allow optional parameters to be used across modules. ! ! -- Daniel Bonniot <bo...@us...> Mon, 29 Apr 2002 19:07:24 +0200 ! ! nice (0.5) unstable; urgency=low ! ! * Recognise the standard arrow notation for functional types ! int->int (int,int)->int (int->int)->int ! The old notation fun(int)(int) is deprecated and will be removed ! before version 1.0 ! * Assigning a possibly null value to a variable of non-null type ! now produces an error instead of a warning. ! * Fixes bug that considered that ! int a = 10, b; ! initializes both a and b to 10. ! * Fixed variable initialization analysis for do-while loops. ! * Make the compiler compatible with JDK 1.4 ! * Fixed bug on MS-Windows with archive creation because of the ! case-insensivity of the file system. ! * Fixed creation of archive from up-to-date packages stored in jar. ! * Accept anonymous functions that do nothing. ! * Editor (emacs) mode is now driven by command-line instead of inspecting ! the EMACS environment variable. This works around a bug in emacs 21.2.1 ! and might be more portable. Also makes it easier to write a nice-mode ! for other editors without changing the existing code or script. ! ! -- Daniel Bonniot <bo...@us...> Thu, 18 Apr 2002 14:44:13 +0200 ! ! nice (0.0.020405) unstable; urgency=low ! ! * Accepts constants: ! final String s1 = "Java style"; ! final s3 = "The type of constants can be omitted"; ! * More compatibility with Java: ! - checks that all statements are reachable ! - checks that local variables are assigned before use ! - classes can be declared public or private ! - ... ! More than half of the Jacks (java compiler testsuite) tests now pass! ! Most failures come from the difference in the syntax of method declaration. ! * Arrays of void values are forbidden. They most probably originate from ! a bug in the source program. ! * Better handling of inhomogenous tuples with native types (e.g. <int, long>) ! * Better wrapping/unwrapping code for arrays used as Collections. ! * Bugfixes for some polymorphic operations on arrays. ! * Bugfixed the bitshift operators >>, >>> and <<. ! ! -- Daniel Bonniot <bo...@us...> Fri, 5 Apr 2002 13:01:17 +0200 ! ! nice (0.0.020226) unstable; urgency=low ! ! * Fixed bug that prevented using "this" in overriden native methods. ! * Better error messages for method calls with wrong number of arguments. ! * Accept methods with no implementation when their domain is empty. ! * Abstract interfaces are fully qualified just like classes and ! correctly list their super-interfaces in the package interface. ! This really makes it possible to use them across packages. ! * Various other bugfixes. ! ! -- Daniel Bonniot <bo...@us...> Tue, 26 Feb 2002 16:06:00 +0100 ! ! nice (0.0.020205) unstable; urgency=low ! ! * Allow multiple variables to be defined together, as in: ! int x = 1, y; ! * Allow variable declaration in tuple affectation: ! (int x, int y) = f(0); ! * Added 'break' and 'continue' statements. ! * Implemented 'do' loops. ! * Allow overriding of native java methods. It is now possible to ! define a subclass of a java class or interface and override the methods. ! * Changed compilation scheme for method alternatives. This results in ! shorter class files and more intuitive stack traces. ! ! -- Daniel Bonniot <bo...@us...> Tue, 5 Feb 2002 13:15:03 +0100 ! ! nice (0.0.020105) unstable; urgency=low ! ! * Allowed to change the type of native class fields. ! This allows in particular to use System.out.println() and such again. ! * Fixed type of if expressions in the presence of non-nullness inference. ! ! -- Daniel Bonniot <bo...@us...> Sat, 5 Jan 2002 14:50:37 +0100 ! ! nice (0.0.020102) unstable; urgency=low ! ! * Made nicec smart about when a local variable might be null. ! * Added the 'instanceof' and '~' (bitwise complement) keywords. ! * Do not stop at the first syntax or type error in more situations. ! * Ehanced error messages. ! * Emacs mode: allow to interactively set the compiler's location ! (the string variable 'nice-program'). ! ! -- Daniel Bonniot <bo...@us...> Wed, 2 Jan 2002 20:31:31 +0100 ! ! nice (0.0.011219) unstable; urgency=low ! ! * Initial Release. ! ! -- Daniel Bonniot <bo...@us...> Tue, 18 Dec 2001 23:23:32 +0100 --- 1,5 ---- ! nice (0.9.4+031130-1) unstable; urgency=low + * Initial release officially in Debian. + -- Daniel Bonniot <bo...@us...> Sun, 30 Nov 2003 12:14:49 +0100 |
From: <bo...@us...> - 2003-11-30 09:49:51
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1:/tmp/cvs-serv11840/debian Removed Files: README.Debian Log Message: Nothing specific about the Deban package to say, so this is not needed. --- README.Debian DELETED --- |
From: <ar...@us...> - 2003-11-30 00:34:58
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang/inline In directory sc8-pr-cvs1:/tmp/cvs-serv2549/F:/nice/stdlib/nice/lang/inline Modified Files: BitOp.java Log Message: Optimization for BitOp.get Index: BitOp.java =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/inline/BitOp.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BitOp.java 1 May 2003 22:42:18 -0000 1.3 --- BitOp.java 30 Nov 2003 00:34:55 -0000 1.4 *************** *** 40,44 **** // Getting a bit ! private static class Get extends Procedure2 implements Inlineable { public void compile (ApplyExp exp, Compilation comp, Target target) --- 40,44 ---- // Getting a bit ! private static class Get extends Procedure2 implements Branchable { public void compile (ApplyExp exp, Compilation comp, Target target) *************** *** 78,92 **** code.emitFi(); } else { ! code.emitIfIntNotZero(); ! code.emitPushBoolean(true); ! code.emitElse(); ! code.emitPushBoolean(false); ! code.emitFi(); } ! target.compileFromStack(comp, Type.boolean_type); ! } public Type getReturnType (Expression[] args) --- 78,156 ---- code.emitFi(); } + + target.compileFromStack(comp, Type.boolean_type); + } + + public void compileJump (Compilation comp, Expression[] args, Label to) + { + CodeAttr code = comp.getCode(); + + Type type0 = args[0].getType(); + boolean isLong = type0 == Type.long_type; + + Target t0 = Target.pushValue(type0); + args[0].compile(comp, t0); + + if (isLong) + code.emitPushLong(1); else + code.emitPushInt(1); + + Target t1 = Target.pushValue(Type.int_type); + args[1].compile(comp, t1); + + code.emitShl(); + + // This is needed for types shorter than int. + if (!isLong) + t0.compileFromStack(comp, Type.int_type); + + code.emitAnd(); + if (isLong) { ! code.emitPushLong(0); ! code.emitGotoIfNE(to); } + else + { + code.emitGotoIfIntNeZero(to); + } + } ! public void compileJumpNot (Compilation comp, Expression[] args, Label to) ! { ! CodeAttr code = comp.getCode(); ! ! Type type0 = args[0].getType(); ! boolean isLong = type0 == Type.long_type; ! ! Target t0 = Target.pushValue(type0); ! args[0].compile(comp, t0); ! ! if (isLong) ! code.emitPushLong(1); ! else ! code.emitPushInt(1); ! ! Target t1 = Target.pushValue(Type.int_type); ! args[1].compile(comp, t1); ! ! code.emitShl(); ! ! // This is needed for types shorter than int. ! if (!isLong) ! t0.compileFromStack(comp, Type.int_type); ! ! code.emitAnd(); ! if (isLong) ! { ! code.emitPushLong(0); ! code.emitGotoIfEq(to); ! } ! else ! { ! code.emitGotoIfIntEqZero(to); ! } ! } public Type getReturnType (Expression[] args) |
From: <ar...@us...> - 2003-11-28 18:02:56
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1:/tmp/cvs-serv29794/F:/nice/stdlib/nice/lang Modified Files: java.nice Log Message: Retypings for java.lang.ref. Index: java.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/java.nice,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** java.nice 26 Nov 2003 00:29:31 -0000 1.45 --- java.nice 28 Nov 2003 18:02:52 -0000 1.46 *************** *** 30,33 **** --- 30,34 ---- import java.text.*; import java.lang.reflect.*; + import java.lang.ref.*; // PACKAGE: java.lang *************** *** 352,353 **** --- 353,376 ---- <T> void update(Observer, Observable, T) = native void Observer.update(Observable, Object); + + // java.lang.ref + class Reference<T> = native java.lang.ref.Reference; + class WeakReference<T> extends Reference<T> = native java.lang.ref.WeakReference; + class SoftReference<T> extends Reference<T> = native java.lang.ref.SoftReference; + class PhantomReference<T> extends Reference<T> = native java.lang.ref.PhantomReference; + class ReferenceQueue<T> = native java.lang.ref.ReferenceQueue; + + <T> WeakReference<T> WeakReference(T) = native new WeakReference(Object); + <T,U | T <: U > WeakReference<T> WeakReference(T, ReferenceQueue<U>) = native new WeakReference(Object, ReferenceQueue); + <T> SoftReference<T> SoftReference(T) = native new SoftReference(Object); + <T,U | T <: U > SoftReference<T> SoftReference(T, ReferenceQueue<U>) = native new SoftReference(Object, ReferenceQueue); + <T,U | T <: U > PhantomReference<T> PhantomReference(T, ReferenceQueue<U>) = native new PhantomReference(Object, ReferenceQueue); + + <T> void clear(Reference<T>) = native void Reference.clear(); + <T> boolean enqueue(Reference<T>) = native boolean Reference.enqueue(); + <T> boolean isEnqueued(Reference<T>) = native boolean Reference.isEnqueued(); + <T, V | T <: ?V> ?V get(Reference<T>) = native Object Reference.get(); + + <T,U | T <: U > Reference<U> poll(ReferenceQueue<T>) = native Reference ReferenceQueue.poll(); + <T,U | T <: U > Reference<U> remove(ReferenceQueue<T>) = native Reference ReferenceQueue.remove(); + <T,U | T <: U > Reference<U> remove(ReferenceQueue<T>, long) = native Reference ReferenceQueue.remove(long); |
From: <bo...@us...> - 2003-11-28 17:44:17
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1:/tmp/cvs-serv26351/debian Modified Files: changelog Log Message: Reduced memory usage when repeatedly compiling in the same JVM (eclipse plugin, ant, testsuite, ...). Index: changelog =================================================================== RCS file: /cvsroot/nice/Nice/debian/changelog,v retrieving revision 1.232 retrieving revision 1.233 diff -C2 -d -r1.232 -r1.233 *** changelog 28 Nov 2003 16:43:29 -0000 1.232 --- changelog 28 Nov 2003 17:44:14 -0000 1.233 *************** *** 23,26 **** --- 23,28 ---- } * Stricter typechecking of anonymous and local functions. + * Reduced memory usage when repeatedly compiling in the same JVM (eclipse + plugin, ant, testsuite, ...). * Bug fixes (accessing static fields of an superclass or interface, compilation of polymorphic tuples, captured 'this' in initializer, |
From: <bo...@us...> - 2003-11-28 17:40:49
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv25830/src/bossa/syntax Modified Files: InlinedMethod.java Log Message: Use the DirectoryClassLoader. Index: InlinedMethod.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/InlinedMethod.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** InlinedMethod.java 19 Nov 2003 01:17:09 -0000 1.15 --- InlinedMethod.java 28 Nov 2003 17:40:45 -0000 1.16 *************** *** 124,132 **** String inlinedMethodsRepository = System.getProperty("nice.inlined"); if (inlinedMethodsRepository != null) ! try { ! inlinedMethodsRepository = "file://" + ! new java.io.File(inlinedMethodsRepository).getAbsolutePath() + '/'; ! loader = new java.net.URLClassLoader ! (new java.net.URL[]{ new java.net.URL(inlinedMethodsRepository) }) { protected Class loadClass(String name, boolean resolve) --- 124,131 ---- String inlinedMethodsRepository = System.getProperty("nice.inlined"); if (inlinedMethodsRepository != null) ! { ! loader = new nice.tools.util.DirectoryClassLoader ! (new java.io.File[]{ new java.io.File(inlinedMethodsRepository) }, ! null) { protected Class loadClass(String name, boolean resolve) *************** *** 162,170 **** } }; - } - catch (java.net.MalformedURLException ex) { - bossa.util.Internal.warning - ("Incorrect location for inlined methods: " + - inlinedMethodsRepository); } } --- 161,164 ---- |
From: <ar...@us...> - 2003-11-28 16:43:32
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1:/tmp/cvs-serv15075/F:/nice/debian Modified Files: changelog Log Message: Updated changelog. Index: changelog =================================================================== RCS file: /cvsroot/nice/Nice/debian/changelog,v retrieving revision 1.231 retrieving revision 1.232 diff -C2 -d -r1.231 -r1.232 *** changelog 25 Nov 2003 19:22:58 -0000 1.231 --- changelog 28 Nov 2003 16:43:29 -0000 1.232 *************** *** 12,17 **** final long serialVersionUID = 123456789L; } * Bug fixes (accessing static fields of an superclass or interface, ! compilation of polymorphic tuples, ...) -- --- 12,30 ---- final long serialVersionUID = 123456789L; } + * Enums are serializable now and have a family() method that returns a list + of all elements in that enum. + * Reduced memory usage when doing multiple compilations in one jvm. + * Added alternative syntax for patterns in method implementations. + 'Type param' for 'param@Type' and '#Type param' for 'param#Type + example usage: + class Dummy { + int x; + equals(Dummy other) = this.x == other.x; + } + * Stricter typechecking of anonymous and local functions. * Bug fixes (accessing static fields of an superclass or interface, ! compilation of polymorphic tuples, captured 'this' in initializer, ! duplication of constructors in bytecode, disappearing contracts during ! recompilation, ... ) -- |
From: <bo...@us...> - 2003-11-28 15:17:38
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv32170/src/bossa/syntax Modified Files: DefaultMethodImplementation.java Log Message: Since there are no functions anymore, we can just print the method declaration for a method with a default implementation. Index: DefaultMethodImplementation.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/DefaultMethodImplementation.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DefaultMethodImplementation.java 24 Nov 2003 14:47:50 -0000 1.3 --- DefaultMethodImplementation.java 28 Nov 2003 15:17:35 -0000 1.4 *************** *** 98,103 **** public void printInterface(java.io.PrintWriter s) { ! s.print(declaration.toString()); ! s.print("= ...\n"); } --- 98,102 ---- public void printInterface(java.io.PrintWriter s) { ! declaration.printInterface(s); } |
From: <bo...@us...> - 2003-11-28 14:49:47
|
Update of /cvsroot/nice/Nice/src/gnu/bytecode In directory sc8-pr-cvs1:/tmp/cvs-serv26084/src/gnu/bytecode Modified Files: SourceMap.java Log Message: Be robust if the file is not specified. Index: SourceMap.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/bytecode/SourceMap.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SourceMap.java 4 Nov 2003 17:10:20 -0000 1.2 --- SourceMap.java 28 Nov 2003 14:49:37 -0000 1.3 *************** *** 83,86 **** --- 83,90 ---- int translate(String file, int line) { + // We cannot do anything without the file name. + if (file == null) + return -1; + if (! file.equals(currentFile) || line < firstLine) { |
From: <ar...@us...> - 2003-11-28 14:39:50
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods In directory sc8-pr-cvs1:/tmp/cvs-serv24232/F:/nice/testsuite/compiler/methods Added Files: syntax.testsuite Log Message: Added alternative syntax for patterns in method implementation 'Bar b' for 'b@Bar', '#Foo f' for 'f#Foo', 'Foo(Bar) f' for 'f@Foo(Bar)'. --- NEW FILE: syntax.testsuite --- /// PASS assert new A(x: 5).equals(new A(x: 5)); /// Toplevel class A { int x; equals(A other) = this.x == other.x; } /// PASS assert foo(new A()) == true; assert foo(new B()) == false; /// Toplevel class A {} class B extends A {} boolean foo(A x); foo(x) = false; foo(#A x) = true; /// PASS /// Toplevel interface X {} interface Y {} class A implements X, Y {} void foo(X x) {} void foo(Y y) {} foo(A(Y) y) {} |
From: <ar...@us...> - 2003-11-28 14:39:50
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1:/tmp/cvs-serv24232/F:/nice/src/bossa/parser Modified Files: Parser.jj Log Message: Added alternative syntax for patterns in method implementation 'Bar b' for 'b@Bar', '#Foo f' for 'f#Foo', 'Foo(Bar) f' for 'f@Foo(Bar)'. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.217 retrieving revision 1.218 diff -C2 -d -r1.217 -r1.218 *** Parser.jj 27 Nov 2003 23:37:08 -0000 1.217 --- Parser.jj 28 Nov 2003 14:39:46 -0000 1.218 *************** *** 1184,1192 **** } { ( val=patternLiteral() { loc = val.location(); } | ! ( "@" | "#" { exactlyAt = true; } ) ! tc=typeIdent() { loc = tc.location(); } | name=ident() --- 1184,1207 ---- } { + ( + LOOKAHEAD( typeIdent() ( ":" | ident() | "(" typeIdent() ")" ident() ) ) + tc=typeIdent() + [ + ":" runtimeTC=typeConstructor() + | + "(" additional=typeIdent() ")" + ] + name=ident() + { loc = tc.location(); } + | + "#" tc=typeIdent() + [ "(" additional=typeIdent() ")" ] + [ name=ident() ] + {exactlyAt = true; loc = tc.location();} + | ( val=patternLiteral() { loc = val.location(); } | ! "@" tc=typeIdent() { loc = tc.location(); } | name=ident() *************** *** 1194,1198 **** "@" tc=typeIdent() ! [ ":" runtimeTC = typeConstructor() ] | "#" tc=typeIdent() { exactlyAt = true; } --- 1209,1213 ---- "@" tc=typeIdent() ! [ ":" runtimeTC=typeConstructor() ] | "#" tc=typeIdent() { exactlyAt = true; } *************** *** 1213,1219 **** ) [ "(" additional=typeIdent() ")" ] ! { ! return new Pattern(name, tc, val, refName, exactlyAt, kind, additional, runtimeTC, loc); ! } } --- 1228,1235 ---- ) [ "(" additional=typeIdent() ")" ] ! ) ! { ! return new Pattern(name, tc, val, refName, exactlyAt, kind, additional, runtimeTC, loc); ! } } |
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv16598/src/bossa/syntax Modified Files: VarScope.java Node.java MethodBodyDefinition.java JavaClasses.java Added Files: GlobalVarScope.java Log Message: Lazy loading of Java classes and methods. This avoids loading huge hierarchy recursively, which improves compilation speed and reduces ambiguities. --- NEW FILE: GlobalVarScope.java --- /**************************************************************************/ /* N I C E */ /* A high-level object-oriented research language */ /* (c) Daniel Bonniot 2003 */ /* */ /* This program is free software; you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation; either version 2 of the License, or */ /* (at your option) any later version. */ /* */ /**************************************************************************/ package bossa.syntax; /** The global scope of symbols. @author Daniel Bonniot (bo...@us...) */ public class GlobalVarScope extends VarScope { GlobalVarScope() { super(null); } /** * The lookup method to call when you need to get a VarSymbol * from its name * * @param i the identifier to lookup * @return the symbols if some were found, null otherwise */ public java.util.List lookup(LocatedString i) { // If there is any method by that name waiting, load it. JavaClasses.nameRequired(i.toString()); return super.lookup(i); } } Index: VarScope.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/VarScope.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** VarScope.java 18 Apr 2003 14:50:20 -0000 1.17 --- VarScope.java 28 Nov 2003 14:01:29 -0000 1.18 *************** *** 22,26 **** @author Daniel Bonniot (d.b...@ma...) */ ! public final class VarScope { public VarScope(VarScope outer) --- 22,26 ---- @author Daniel Bonniot (d.b...@ma...) */ ! public class VarScope { public VarScope(VarScope outer) Index: Node.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Node.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** Node.java 22 Jul 2003 16:55:31 -0000 1.57 --- Node.java 28 Nov 2003 14:01:29 -0000 1.58 *************** *** 182,187 **** */ ! private static VarScope globalScope; ! public static final VarScope getGlobalScope() { return globalScope; --- 182,187 ---- */ ! private static GlobalVarScope globalScope; ! public static final GlobalVarScope getGlobalScope() { return globalScope; *************** *** 201,205 **** { JavaClasses.compilation = module.compilation(); ! globalScope = new VarScope(null); globalTypeScope = new GlobalTypeScope(); } --- 201,205 ---- { JavaClasses.compilation = module.compilation(); ! globalScope = new GlobalVarScope(); globalTypeScope = new GlobalTypeScope(); } Index: MethodBodyDefinition.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodBodyDefinition.java,v retrieving revision 1.144 retrieving revision 1.145 diff -C2 -d -r1.144 -r1.145 *** MethodBodyDefinition.java 24 Nov 2003 14:47:50 -0000 1.144 --- MethodBodyDefinition.java 28 Nov 2003 14:01:29 -0000 1.145 *************** *** 126,132 **** Returns the symbol of the method this declaration belongs to. */ ! private VarSymbol findSymbol(VarScope scope) { - List symbols = scope.lookup(name); if(symbols.size() == 0) return null; --- 126,131 ---- Returns the symbol of the method this declaration belongs to. */ ! private VarSymbol findSymbol(List symbols) { if(symbols.size() == 0) return null; *************** *** 290,300 **** Pattern.resolve(typeScope, getGlobalScope(), formals); } ! void lateBuildScope() { Pattern.resolveValues(formals); ! VarSymbol s = findSymbol(scope); if(s==null) --- 289,304 ---- Pattern.resolve(typeScope, getGlobalScope(), formals); + + symbols = scope.lookup(name); } ! ! private List symbols; ! void lateBuildScope() { Pattern.resolveValues(formals); ! VarSymbol s = findSymbol(symbols); ! symbols = null; if(s==null) Index: JavaClasses.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/JavaClasses.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** JavaClasses.java 23 Nov 2003 16:25:17 -0000 1.40 --- JavaClasses.java 28 Nov 2003 14:01:30 -0000 1.41 *************** *** 211,214 **** --- 211,215 ---- { retyped = new HashMap(); + knownMethods = new HashMap(); } *************** *** 358,390 **** continue; ! if (m.isConstructor()) ! { ! JavaMethod res = JavaMethod.make(m, true); ! ! if (res != null) ! { ! TypeConstructors.addConstructor(tc, res); ! retyped.put(m, res); ! } ! else if(Debug.javaTypes) ! Debug.println("Constructor " + m + " ignored"); ! } ! else ! { ! /* We don't need to put static methods in the global scope. ! They can and must be accessed by specifying the class ! explicitely, like in Java. ! */ ! if (m.getStaticFlag()) ! continue; ! ! Method base = baseMethod(classType, m); ! if (base != null) ! continue; ! ! if (Debug.javaTypes) ! Debug.println("Loaded native method " + m); ! addSymbol(m, JavaMethod.make(m, false)); ! } } } --- 359,363 ---- continue; ! fetch(m, tc, classType); } } *************** *** 399,402 **** --- 372,449 ---- " has an invalid bytecode format"); } + } + + private static void fetch(Method m, TypeConstructor tc, ClassType classType) + { + if (m.isConstructor()) + { + JavaMethod res = JavaMethod.make(m, true); + + if (res != null) + { + TypeConstructors.addConstructor(tc, res); + retyped.put(m, res); + } + else if(Debug.javaTypes) + Debug.println("Constructor " + m + " ignored"); + } + else + { + /* We don't need to put static methods in the global scope. + They can and must be accessed by specifying the class + explicitely, like in Java. + */ + if (m.getStaticFlag()) + return; + + Method base = baseMethod(classType, m); + if (base != null) + return; + + registerMethod(m); + } + } + + private static Map knownMethods; + + /** Remember that we know a method of this name, so that we can load it + lazily, if that name is searched. + */ + private static void registerMethod(Method m) + { + List methods = (List) knownMethods.get(m.getName()); + if (methods == null) + { + methods = new ArrayList(); + knownMethods.put(m.getName(), methods); + } + methods.add(m); + } + + /** Called when the given name is going to be needed. */ + static void nameRequired(String name) + { + List methods = (List) knownMethods.get(name); + if (methods == null) + return; + knownMethods.remove(name); + + for (Iterator i = methods.iterator(); i.hasNext();) + { + Method m = (Method) i.next(); + loadMethod(m); + } + } + + /** Actually load the method. */ + private static void loadMethod(Method m) + { + if (Debug.javaTypes) + Debug.println("Loaded native method " + m); + + if (retyped.get(m) != null) + return; + + addSymbol(m, JavaMethod.make(m, false)); } |
From: <bo...@us...> - 2003-11-28 14:01:35
|
Update of /cvsroot/nice/Nice/regtest/java In directory sc8-pr-cvs1:/tmp/cvs-serv16598/regtest/java Modified Files: Makefile Added Files: lazyLoading.nice Log Message: Lazy loading of Java classes and methods. This avoids loading huge hierarchy recursively, which improves compilation speed and reduces ambiguities. --- NEW FILE: lazyLoading.nice --- package regtest.java; class SubJ extends regtest.java.J.J {} jMethod(s@SubJ, o) { if (o != null) o.otherMethod(); } Index: Makefile =================================================================== RCS file: /cvsroot/nice/Nice/regtest/java/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile 17 Oct 2003 15:25:50 -0000 1.1 --- Makefile 28 Nov 2003 14:01:31 -0000 1.2 *************** *** 1,3 **** ! all: B/BIj.class B/BAj.class A/An.class A/In.class: A/A.nice --- 1,3 ---- ! all: B/BIj.class B/BAj.class J/J.class J/Other.class A/An.class A/In.class: A/A.nice *************** *** 9,10 **** --- 9,16 ---- B/BIj.class: A/In.class B/BIj.java javac -classpath "${NICE_TOP}" B/BIj.java + + J/J.class: J/J.java + javac -classpath "${NICE_TOP}" J/J.java + + J/Other.class: J/Other.java + javac -classpath "${NICE_TOP}" J/Other.java |
From: <bo...@us...> - 2003-11-28 14:01:34
|
Update of /cvsroot/nice/Nice/regtest/java/J In directory sc8-pr-cvs1:/tmp/cvs-serv16598/regtest/java/J Added Files: Other.java J.java Log Message: Lazy loading of Java classes and methods. This avoids loading huge hierarchy recursively, which improves compilation speed and reduces ambiguities. --- NEW FILE: Other.java --- package regtest.java.J; public class Other { void otherMethod() {} } --- NEW FILE: J.java --- package regtest.java.J; public class J { void jMethod(Other o) {} } |
From: <bo...@us...> - 2003-11-28 13:59:39
|
Update of /cvsroot/nice/Nice/regtest/java/J In directory sc8-pr-cvs1:/tmp/cvs-serv16064/regtest/java/J Log Message: Directory /cvsroot/nice/Nice/regtest/java/J added to the repository |
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv14447/src/bossa/syntax Modified Files: UserOperator.java MethodDeclaration.java IdentExp.java Contract.java CallExp.java AST.java Log Message: Make sure that contracts are not lost when importing packages. Index: UserOperator.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/UserOperator.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** UserOperator.java 24 Jun 2003 15:28:19 -0000 1.5 --- UserOperator.java 28 Nov 2003 13:52:08 -0000 1.6 *************** *** 75,78 **** --- 75,83 ---- } + public String toString() + { + return super.toString() + contract.toString(); + } + private MonoSymbol[] symbols; *************** *** 105,107 **** --- 110,122 ---- } + void typecheckCompiled() + { + /* We only need typechecking if there is a contract, to resolve + overloading. + We will probably be able to remove this if contracts cen be reloaded + from bytecode. + */ + if (contract != Contract.noContract) + typecheck(); + } } Index: MethodDeclaration.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodDeclaration.java,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** MethodDeclaration.java 21 Nov 2003 08:09:58 -0000 1.50 --- MethodDeclaration.java 28 Nov 2003 13:52:08 -0000 1.51 *************** *** 226,229 **** --- 226,235 ---- } + /** Typechecking when the package has already been compiled. */ + void typecheckCompiled() + { + // Nothing by default + } + /**************************************************************** * Module interface Index: IdentExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/IdentExp.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** IdentExp.java 2 Apr 2002 13:06:36 -0000 1.23 --- IdentExp.java 28 Nov 2003 13:52:08 -0000 1.24 *************** *** 63,66 **** --- 63,74 ---- } + public String toString(int param) + { + if (param == Printable.parsable) + return "`" + ident.toString() + "`"; + else + return super.toString(param); + } + protected LocatedString ident; Index: Contract.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Contract.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Contract.java 24 Jun 2003 15:28:19 -0000 1.5 --- Contract.java 28 Nov 2003 13:52:08 -0000 1.6 *************** *** 28,31 **** --- 28,32 ---- { pre.add(CallExp.create(symbol(assertName, condition), condition)); + requireRepr.append(condition).append(','); } *************** *** 33,36 **** --- 34,38 ---- { pre.add(CallExp.create(symbol(assertName, condition), condition, name)); + requireRepr.append(condition).append(':').append(name).append(','); } *************** *** 38,41 **** --- 40,44 ---- { post.add(CallExp.create(symbol(assertName, condition), condition)); + ensureRepr.append(condition); } *************** *** 43,46 **** --- 46,50 ---- { post.add(CallExp.create(symbol(assertName, condition), condition, name)); + ensureRepr.append(condition).append(':').append(name).append(','); } *************** *** 50,53 **** --- 54,60 ---- private List post = new LinkedList(); + private StringBuffer requireRepr = new StringBuffer("requires "); + private StringBuffer ensureRepr = new StringBuffer("ensures "); + private Expression symbol(String name, Located loc) { *************** *** 115,118 **** --- 122,135 ---- } + public String toString() + { + StringBuffer res = new StringBuffer(); + if (preExp.length > 0) + res.append(requireRepr.toString()); + if (postExp.length > 0) + res.append(ensureRepr.toString()); + return res.toString(); + } + public static final Contract noContract = new Contract() { void resolve(VarScope scope, TypeScope typeScope) {} *************** *** 123,126 **** --- 140,145 ---- return body; } + + public String toString() { return ""; } }; } Index: CallExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/CallExp.java,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** CallExp.java 25 Aug 2003 18:09:10 -0000 1.84 --- CallExp.java 28 Nov 2003 13:52:08 -0000 1.85 *************** *** 367,371 **** { if (!infix) ! return function.toString() + arguments; if (declaringClass == null) --- 367,371 ---- { if (!infix) ! return function.toString(Printable.parsable) + arguments; if (declaringClass == null) Index: AST.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/AST.java,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** AST.java 12 Sep 2003 23:20:41 -0000 1.51 --- AST.java 28 Nov 2003 13:52:08 -0000 1.52 *************** *** 164,168 **** if (! compiling) ! return; doTypecheck(); --- 164,173 ---- if (! compiling) ! { ! for (int i = 0; i < methods.length; i++) ! methods[i].typecheckCompiled(); ! ! return; ! } doTypecheck(); |