nice-commit Mailing List for The Nice Programming Language (Page 51)
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: Daniel B. <bo...@us...> - 2004-03-20 15:35:29
|
Update of /cvsroot/nice/Nice/testsuite/compiler/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27935/testsuite/compiler/native Modified Files: fields.testsuite Log Message: Renamed retyped constructors for File to avoid clash with static field access. Index: fields.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/native/fields.testsuite,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** fields.testsuite 20 Mar 2004 14:21:02 -0000 1.3 --- fields.testsuite 20 Mar 2004 15:25:29 -0000 1.4 *************** *** 19,25 **** } ! /// PASS bug foo(File.separator); /// Toplevel void foo(String) {} void foo(char) {} --- 19,27 ---- } ! /// PASS foo(File.separator); /// Toplevel + import java.io.*; + void foo(String) {} void foo(char) {} |
From: Daniel B. <bo...@us...> - 2004-03-20 14:31:00
|
Update of /cvsroot/nice/Nice/testsuite/compiler/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15899/testsuite/compiler/native Modified Files: fields.testsuite Log Message: Access to static field without context information for the expected type. Index: fields.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/native/fields.testsuite,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** fields.testsuite 31 Jul 2003 19:32:05 -0000 1.2 --- fields.testsuite 20 Mar 2004 14:21:02 -0000 1.3 *************** *** 18,19 **** --- 18,25 ---- } } + + /// PASS bug + foo(File.separator); + /// Toplevel + void foo(String) {} + void foo(char) {} |
From: Daniel B. <bo...@us...> - 2004-03-20 12:30:28
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26395 Modified Files: collections.nice Log Message: Use a default value refering to previous arguments. Index: collections.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/collections.nice,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** collections.nice 20 Mar 2004 11:26:13 -0000 1.62 --- collections.nice 20 Mar 2004 12:20:28 -0000 1.63 *************** *** 97,105 **** } ! <T> List<T> slice(List<T> list, int from = 0, int to = -1) { - if (to == -1) - to = list.size() - 1; - List<T> res = new ArrayList(to - from + 1); for (int i = from; i <= to; i++) --- 97,102 ---- } ! <T> List<T> slice(List<T> list, int from = 0, int to = list.size() - 1) { List<T> res = new ArrayList(to - from + 1); for (int i = from; i <= to; i++) |
From: Arjan B. <ar...@us...> - 2004-03-20 11:36:11
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18964/F:/nice/stdlib/nice/lang Modified Files: array.nice collections.nice strings.nice Log Message: Minor update to stdlib (made some overrides explicit, more precise type for filter). Index: collections.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/collections.nice,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** collections.nice 27 Feb 2004 15:29:52 -0000 1.61 --- collections.nice 20 Mar 2004 11:26:13 -0000 1.62 *************** *** 32,38 **** <Collection C, T, U> C<U> map(C<T> coll, T->U func); ! //<Collection C, T, U | T <: U> C<U> filter(C<T>, T->boolean); ! //temporaly using a non polymorpic return because of type inference ! <Collection C, T> C<T> filter(C<T>, T->boolean); /** Return a collection containing all the elements for which converter --- 32,36 ---- <Collection C, T, U> C<U> map(C<T> coll, T->U func); ! <Collection C, T, U | T <: U> C<U> filter(C<T>, T->boolean); /** Return a collection containing all the elements for which converter *************** *** 136,142 **** } ! <C,T> filter(coll, test) { ! C<T> res = coll.similarEmptyCollection(); for (T elem : coll) if (test(elem)) --- 134,140 ---- } ! <C,T,U> filter(coll, test) { ! C<U> res = coll.similarEmptyCollection(); for (T elem : coll) if (test(elem)) Index: array.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/array.nice,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** array.nice 1 Mar 2004 17:16:13 -0000 1.33 --- array.nice 20 Mar 2004 11:26:13 -0000 1.34 *************** *** 91,100 **** <C,T,U> map(a@Array, func) = fill(new U[a.length], int i => func(a[i])); ! <C,T> filter(a@Array, test) { int l = a.length; int found = 0; ! T[] res = cast(new T[l]); a.foreach(T elem => --- 91,100 ---- <C,T,U> map(a@Array, func) = fill(new U[a.length], int i => func(a[i])); ! <C,T,U> filter(a@Array, test) { int l = a.length; int found = 0; ! U[] res = cast(new U[l]); a.foreach(T elem => *************** *** 110,114 **** } */ ! <T> ?T search(!T[] a, (!T)->boolean test) { for (int i = 0; i < a.length; i++) --- 110,114 ---- } */ ! /*<T> ?T search(!T[] a, (!T)->boolean test) { for (int i = 0; i < a.length; i++) *************** *** 117,120 **** --- 117,121 ---- return null; } + */ /** *************** *** 169,172 **** } ! <T, T1, T2 | T1 <: T, T2 <: T> T[] `+`(T1[] a1, T2[] a2) = concat(a1,a2); --- 170,173 ---- } ! override <T, T1, T2 | T1 <: T, T2 <: T> T[] `+`(T1[] a1, T2[] a2) = concat(a1,a2); Index: strings.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/strings.nice,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** strings.nice 27 Feb 2004 17:39:30 -0000 1.15 --- strings.nice 20 Mar 2004 11:26:13 -0000 1.16 *************** *** 28,32 **** <T> String `+`(String s, T o) = s.concat(String.valueOf(o)); <!T> String `+`(T o, String s) = o.toString().concat(s); ! String `+`(String s1, String s2) = s1.concat(s2); int indexOf(String, char) = native int String.indexOf(int); --- 28,32 ---- <T> String `+`(String s, T o) = s.concat(String.valueOf(o)); <!T> String `+`(T o, String s) = o.toString().concat(s); ! override String `+`(String s1, String s2) = s1.concat(s2); int indexOf(String, char) = native int String.indexOf(int); |
From: Francis B. <fb...@us...> - 2004-03-20 05:12:33
|
Update of /cvsroot/nice/Nice/src/nice/tools/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27160/src/nice/tools/doc Modified Files: htmlwriter.nice Log Message: Added more information to the method names in the package index. Rather than just having the method name, it now displays <a>foo</a>: (String, int)->String, for example. Index: htmlwriter.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/doc/htmlwriter.nice,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** htmlwriter.nice 14 Mar 2004 14:49:36 -0000 1.4 --- htmlwriter.nice 20 Mar 2004 05:02:38 -0000 1.5 *************** *** 84,91 **** //Initialise a FileWriter File dir = new File(outdir, packageName.replace('.','/')); ! if(!dir.exists()) { ! if(!dir.mkdirs()) { ! System.err.println("Error creating directory structure"); ! } } String fileName = m.getName().toString(); --- 84,89 ---- //Initialise a FileWriter File dir = new File(outdir, packageName.replace('.','/')); ! if(!dir.exists() && !dir.mkdirs()) { ! System.err.println("Error creating directory structure"); } String fileName = m.getName().toString(); *************** *** 128,135 **** try { File dir = new File(outdir, p.getName().replace('.','/')); ! if(!dir.exists()) { ! if(!dir.mkdirs()) { System.err.println("Error creating directory structure"); - } } BufferedWriter writer = new BufferedWriter --- 126,131 ---- try { File dir = new File(outdir, p.getName().replace('.','/')); ! if(!dir.exists() && !dir.mkdirs()) { System.err.println("Error creating directory structure"); } BufferedWriter writer = new BufferedWriter *************** *** 171,175 **** writer.write("<ul>\n"); for(MethodDeclaration m : methods) { ! writer.write("<li><a href='" + m.getName() + ".html'>" + m.getName() + "</a></li>\n"); } writer.write("</ul>\n"); --- 167,172 ---- writer.write("<ul>\n"); for(MethodDeclaration m : methods) { ! writer.write("<li><a href='" + m.getName() + ".html'>" + m.getName() + "</a>" + ! ": " + m.getType() + "</li>\n"); } writer.write("</ul>\n"); |
From: Daniel B. <bo...@us...> - 2004-03-17 17:16:37
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22525/testsuite/compiler/typing Added Files: inference.testsuite Log Message: Do type inference on local bindings with polymorphic values. --- NEW FILE: inference.testsuite --- /// Global class A<FOO> { void poly(FOO) {} } class B<BAR> extends A<FOO> {} /// PASS let x = new A(); x.poly(""); /// FAIL let x = new B(); x.poly(""); x. /*/// FAIL HERE*/ poly(0); /// PASS /// Toplevel <T> void foo() { let x = new A(); x.poly(""); } /// FAIL /// Toplevel <T> void foo() { let x = new A(); x.poly(""); x. /*/// FAIL HERE*/ poly(0); } /// PASS /// Toplevel void foo(); foo() { let x = new A(); x.poly(""); } /// FAIL /// Toplevel void foo(); foo() { let x = new A(); x.poly(""); x. /*/// FAIL HERE*/ poly(0); } /// PASS let l = new ArrayList(); l.add("..."); /// FAIL let l = new ArrayList(); l.add("..."); l. /*/// FAIL HERE*/ add(0); /// PASS let l1 = new ArrayList(); let l2 = new ArrayList(); l1.add("..."); l2.add(l1.get(0)); l2.add("."); /// FAIL let l1 = new ArrayList(); let l2 = new ArrayList(); l1.add("..."); l2.add(l1.get(0)); l2. /*/// FAIL HERE*/ add(0); /// PASS let l1 = new ArrayList(); let l2 = new ArrayList(); ()->void action = () => l2.add(l1.get(0)); l1.add("..."); action(); l2.add("."); /// FAIL let l1 = new ArrayList(); let l2 = new ArrayList(); ()->void action = () => l2.add(l1.get(0)); l1.add("..."); action(); l2. /*/// FAIL HERE*/ add(0); /// FAIL var l = new LinkedList(); l.add(""); if (l.size == 1) { l = new LinkedList(); l./*/// FAIL HERE*/ add(0); } String s = l.get(0); |
From: Daniel B. <bo...@us...> - 2004-03-17 17:05:08
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19931/src/bossa/syntax Modified Files: typecheck.nice tools.nice NiceMethod.java MethodDeclaration.java Log Message: Do type inference on local bindings with polymorphic values. Index: tools.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/tools.nice,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** tools.nice 25 Feb 2004 11:23:28 -0000 1.32 --- tools.nice 17 Mar 2004 16:55:34 -0000 1.33 *************** *** 66,82 **** notNull(bossa.syntax.Monotype.maybe(nice.tools.typing.Types.rawType(m))); ! mlsub.typing.Monotype checkMonomorphic(mlsub.typing.Polytype type, ! Block.LocalValue decl) { ! if (! type.isMonomorphic()) ! { ! type.simplify(); ! if (! type.isMonomorphic()) ! throw new bossa.util.UserError ! (decl, ! "The value has a polymorphic type: " + type + ! "\nOmitting the type here is not supported by Nice yet." + ! "\nPlease declare the monomorphic type of " + decl.getName()); } --- 66,79 ---- notNull(bossa.syntax.Monotype.maybe(nice.tools.typing.Types.rawType(m))); ! mlsub.typing.Monotype ensureMonomorphic(mlsub.typing.Polytype type, ! Block.LocalValue decl) { ! type.simplify(); ! if (type.getConstraint != null) ! { ! // If the type is polymorphic, we treat the type variables as soft: ! // we enter them in the context, so they are not generalized. ! type.getConstraint.enter(true); } *************** *** 84,88 **** } ! /* Make sure that the error is attached to a location. If not, located it a the given located object (which should be a close --- 81,85 ---- } ! /* Make sure that the error is attached to a location. If not, located it a the given located object (which should be a close Index: typecheck.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** typecheck.nice 25 Feb 2004 11:23:28 -0000 1.97 --- typecheck.nice 17 Mar 2004 16:55:34 -0000 1.98 *************** *** 669,673 **** value.typecheck(); e.initValue = decl.value = value = value.noOverloading(); ! target.type = checkMonomorphic(value.getType(), decl); if (nice.tools.typing.Types.isVoid(target.type)) --- 669,673 ---- value.typecheck(); e.initValue = decl.value = value = value.noOverloading(); ! target.type = ensureMonomorphic(value.getType(), decl); if (nice.tools.typing.Types.isVoid(target.type)) *************** *** 734,738 **** value.typecheck(); decl.value = value = value.noOverloading(); ! target.type = checkMonomorphic(value.getType(), decl); if (target.type == PrimitiveType.byteType || target.type == PrimitiveType.shortType) --- 734,738 ---- value.typecheck(); decl.value = value = value.noOverloading(); ! target.type = ensureMonomorphic(value.getType(), decl); if (target.type == PrimitiveType.byteType || target.type == PrimitiveType.shortType) *************** *** 770,774 **** mlsub.typing.Polytype type = notNull(decl.value).getType(); ! notNull(decl.left).type = checkMonomorphic(type, decl); if (nice.tools.typing.Types.isVoid(notNull(decl.left).type)) throw error(decl, "A variable cannot have a void type"); --- 770,775 ---- mlsub.typing.Polytype type = notNull(decl.value).getType(); ! notNull(decl.left).type = ensureMonomorphic(type, decl); ! if (nice.tools.typing.Types.isVoid(notNull(decl.left).type)) throw error(decl, "A variable cannot have a void type"); *************** *** 1003,1006 **** // Local Variables: ! // nice-xprogram: "nicec -d \"$HOME/Nice/classes\" --sourcepath=\"$HOME/Nice/src\" --classpath=\"$HOME/Nice/classes\"" // End: --- 1004,1007 ---- // Local Variables: ! // nice-xprogram: "$HOME/Nice/bin/nicec -d ../classes" // End: Index: NiceMethod.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/NiceMethod.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** NiceMethod.java 17 Mar 2004 00:36:46 -0000 1.36 --- NiceMethod.java 17 Mar 2004 16:55:34 -0000 1.37 *************** *** 349,353 **** { super.innerTypecheck(); ! implementation.innerTypecheck(); } --- 349,357 ---- { super.innerTypecheck(); ! try { ! implementation.innerTypecheck(); ! } finally { ! mlsub.typing.lowlevel.Engine.existentialLevel = 0; ! } } Index: MethodDeclaration.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodDeclaration.java,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** MethodDeclaration.java 5 Mar 2004 16:24:26 -0000 1.56 --- MethodDeclaration.java 17 Mar 2004 16:55:34 -0000 1.57 *************** *** 211,214 **** --- 211,215 ---- } + UserError error = null; try{ Typing.enter(); *************** *** 216,220 **** try{ type.getConstraint().enter(); ! innerTypecheck(); } finally{ --- 217,226 ---- try{ type.getConstraint().enter(); ! ! try { ! innerTypecheck(); ! } catch(UserError e){ ! error = e; ! } } finally{ *************** *** 223,230 **** } catch(TypingEx e){ ! User.error(this, ! "The type of method " + symbol.name + ! " is not well formed: " + type + "\n" + e); } } --- 229,240 ---- } catch(TypingEx e){ ! // If we got an earlier error, it's preferable to report that one. ! if (error == null) ! User.error(this, ! "The type of method " + symbol.name + ! " is not well formed: " + type + "\n" + e); } + if (error != null) + throw error; } |
From: Daniel B. <bo...@us...> - 2004-03-17 17:05:08
|
Update of /cvsroot/nice/Nice/src/mlsub/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19931/src/mlsub/typing Modified Files: Variance.java TypeConstructor.java TupleKind.java TopMonotype.java NullnessKind.java MonotypeVar.java Monotype.java FunTypeKind.java Constraint.java Log Message: Do type inference on local bindings with polymorphic values. Index: Variance.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/Variance.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Variance.java 7 Sep 2002 16:29:10 -0000 1.15 --- Variance.java 17 Mar 2004 16:55:33 -0000 1.16 *************** *** 116,125 **** } ! public Monotype freshMonotype() { TypeConstructor tc = new TypeConstructor(this); Typing.introduce(tc); ! Monotype[] tp = MonotypeVar.news(this.size); Typing.introduce(tp); --- 116,125 ---- } ! public Monotype freshMonotype(boolean existential) { TypeConstructor tc = new TypeConstructor(this); Typing.introduce(tc); ! Monotype[] tp = MonotypeVar.news(this.size, existential); Typing.introduce(tp); Index: FunTypeKind.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/FunTypeKind.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FunTypeKind.java 21 Jun 2002 07:18:28 -0000 1.6 --- FunTypeKind.java 17 Mar 2004 16:55:34 -0000 1.7 *************** *** 45,54 **** } ! public Monotype freshMonotype() { ! Monotype codomain = new MonotypeVar(); Typing.introduce(codomain); ! Monotype[] domain = MonotypeVar.news(domainArity); Typing.introduce(domain); --- 45,54 ---- } ! public Monotype freshMonotype(boolean existential) { ! Monotype codomain = new MonotypeVar(existential); Typing.introduce(codomain); ! Monotype[] domain = MonotypeVar.news(domainArity, existential); Typing.introduce(domain); Index: MonotypeVar.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/MonotypeVar.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** MonotypeVar.java 3 Dec 2003 21:50:41 -0000 1.15 --- MonotypeVar.java 17 Mar 2004 16:55:34 -0000 1.16 *************** *** 32,35 **** --- 32,40 ---- } + public MonotypeVar(boolean existential) + { + this.existential = existential; + } + public MonotypeVar(String name) { *************** *** 75,78 **** --- 80,88 ---- public static MonotypeVar[] news(int n) { + return news(n, false); + } + + static MonotypeVar[] news(int n, boolean existential) + { if (n == 0) return null; *************** *** 80,84 **** for(int i=0; i<n; i++) { ! res[i] = new MonotypeVar(); res[i].persistentKind = NullnessKind.instance; } --- 90,94 ---- for(int i=0; i<n; i++) { ! res[i] = new MonotypeVar(existential); res[i].persistentKind = NullnessKind.instance; } *************** *** 123,128 **** { // Do the appropriate cast ! equivalent = value.freshMonotype(); ! if (Typing.dbg) Debug.println("Equivalence: " + this + " == " + equivalent); --- 133,138 ---- { // Do the appropriate cast ! equivalent = value.freshMonotype(existential); ! if (Typing.dbg) Debug.println("Equivalence: " + this + " == " + equivalent); *************** *** 190,193 **** --- 200,208 ---- } + private boolean existential; + + public void setExistential() { existential = true; } + public boolean isExistential() { return existential; } + /**************************************************************** * Misc. Index: NullnessKind.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/NullnessKind.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullnessKind.java 31 Aug 2003 00:32:56 -0000 1.2 --- NullnessKind.java 17 Mar 2004 16:55:34 -0000 1.3 *************** *** 40,44 **** private static TypeConstructor maybe, sure; ! public Monotype freshMonotype() { TypeConstructor tc = new TypeConstructor(instance); --- 40,44 ---- private static TypeConstructor maybe, sure; ! public Monotype freshMonotype(boolean existential) { TypeConstructor tc = new TypeConstructor(instance); *************** *** 51,55 **** } ! Monotype raw = new MonotypeVar(); Typing.introduce(raw); --- 51,55 ---- } ! Monotype raw = new MonotypeVar(existential); Typing.introduce(raw); Index: Monotype.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/Monotype.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Monotype.java 1 Mar 2003 00:58:28 -0000 1.9 --- Monotype.java 17 Mar 2004 16:55:34 -0000 1.10 *************** *** 55,58 **** --- 55,65 ---- } + public boolean isExistential() + { + // This is a default implementation. Only MonotypeVar need to be + // considered existential. + return false; + } + /**************************************************************** * Substitution Index: TypeConstructor.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/TypeConstructor.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** TypeConstructor.java 24 Feb 2004 18:35:26 -0000 1.17 --- TypeConstructor.java 17 Mar 2004 16:55:34 -0000 1.18 *************** *** 106,109 **** --- 106,115 ---- } + public boolean isExistential() + { + // Only MonotypeVars need to be marked as existential. + return false; + } + /**************************************************************** * Kinding Index: TupleKind.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/TupleKind.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TupleKind.java 24 Sep 2002 12:11:24 -0000 1.6 --- TupleKind.java 17 Mar 2004 16:55:34 -0000 1.7 *************** *** 46,52 **** private static final TupleKind tupleKinds[] = new TupleKind[200]; ! public Monotype freshMonotype() { ! Monotype[] args = MonotypeVar.news(arity); Typing.introduce(args); --- 46,52 ---- private static final TupleKind tupleKinds[] = new TupleKind[200]; ! public Monotype freshMonotype(boolean existential) { ! Monotype[] args = MonotypeVar.news(arity, existential); Typing.introduce(args); Index: TopMonotype.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/TopMonotype.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TopMonotype.java 4 Dec 2003 13:06:37 -0000 1.1 --- TopMonotype.java 17 Mar 2004 16:55:34 -0000 1.2 *************** *** 73,77 **** } ! public Monotype freshMonotype() { return null; --- 73,77 ---- } ! public Monotype freshMonotype(boolean existential) { return null; Index: Constraint.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/Constraint.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Constraint.java 22 Aug 2002 18:02:03 -0000 1.8 --- Constraint.java 17 Mar 2004 16:55:34 -0000 1.9 *************** *** 293,296 **** --- 293,307 ---- } + public void enter(boolean existential) + throws TypingEx + { + if (existential && binders != null) + for(int i=0; i < nbinders; i++) + if (binders[i] instanceof MonotypeVar) + ((MonotypeVar) binders[i]).setExistential(); + + enter(); + } + /**************************************************************** * Printing |
From: Daniel B. <bo...@us...> - 2004-03-17 17:05:02
|
Update of /cvsroot/nice/Nice/src/mlsub/typing/lowlevel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19931/src/mlsub/typing/lowlevel Modified Files: Kind.java Engine.java Element.java Log Message: Do type inference on local bindings with polymorphic values. Index: Element.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/Element.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Element.java 2 Aug 2000 16:55:52 -0000 1.2 --- Element.java 17 Mar 2004 16:55:33 -0000 1.3 *************** *** 35,37 **** --- 35,39 ---- */ boolean isConcrete(); + + boolean isExistential(); } Index: Kind.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/Kind.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Kind.java 2 Aug 2000 16:55:53 -0000 1.2 --- Kind.java 17 Mar 2004 16:55:33 -0000 1.3 *************** *** 1,49 **** ! /**************************************************************************/ ! /* B O S S A */ ! /* A simple imperative object-oriented research language */ ! /* (c) Daniel Bonniot 1999 */ ! /* */ ! /* 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. */ ! /* */ ! /**************************************************************************/ ! ! // File : Kind.java ! // Created : Wed Jul 28 14:53:22 1999 by bonniot ! //$Modified: Wed Aug 02 16:51:36 2000 by Daniel Bonniot $ ! ! package mlsub.typing.lowlevel; ! ! /** Something that knows how to assert constraints on objects of this "Kind" ! * ! * (implemented by Variance, Low level constraints... ) ! * ! * @author bonniot ! */ ! public interface Kind ! { ! /** Asserts that two elements are in a certain order ! * ! * @exception Unsatisfiable ! * @param e1 The smaller element ! * @param e2 The greater element ! */ ! void leq(Element e1, Element e2) throws Unsatisfiable; ! void leq(Element e1, Element e2, boolean initial) throws Unsatisfiable; ! ! /** Introduce a new Element of this kind ! * ! * @param e ! */ ! void register(Element e); ! ! /** ! Return a fresh monotype of this kind, or null if that does not make sense. ! ! This makes a dependancy from mlsub.typing.lowlevel to mlsub.typing, ! but they are likely to be used together anyway. ! */ ! mlsub.typing.Monotype freshMonotype(); ! } --- 1,45 ---- ! /**************************************************************************/ ! /* N I C E */ ! /* A high-level object-oriented research language */ ! /* (c) Daniel Bonniot 2004 */ ! /* */ ! /* 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 mlsub.typing.lowlevel; ! ! /** Something that knows how to assert constraints on objects of this "Kind" ! * ! * (implemented by Variance, Low level constraints... ) ! * ! * @author Daniel Bonniot ! */ ! public interface Kind ! { ! /** Asserts that two elements are in a certain order ! * ! * @exception Unsatisfiable ! * @param e1 The smaller element ! * @param e2 The greater element ! */ ! void leq(Element e1, Element e2) throws Unsatisfiable; ! void leq(Element e1, Element e2, boolean initial) throws Unsatisfiable; ! ! /** Introduce a new Element of this kind ! * ! * @param e ! */ ! void register(Element e); ! ! /** ! Return a fresh monotype of this kind, or null if that does not make sense. ! ! This makes a dependancy from mlsub.typing.lowlevel to mlsub.typing, ! but they are likely to be used together anyway. ! */ ! mlsub.typing.Monotype freshMonotype(boolean existential); ! } Index: Engine.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/Engine.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Engine.java 12 Dec 2003 19:24:53 -0000 1.28 --- Engine.java 17 Mar 2004 16:55:33 -0000 1.29 *************** *** 43,53 **** floating.mark(); soft.mark(); ! frozenLeqs.mark(); ! for(Iterator i = constraints.iterator(); ! i.hasNext();) ! { ! Engine.Constraint k = (Engine.Constraint)i.next(); ! k.mark(); ! //k.rigidify(); } } --- 43,59 ---- floating.mark(); soft.mark(); ! ! // Once we are in existential mode, we don't mark/backtrack. ! if (existentialLevel > 0) ! existentialLevel++; ! else ! { ! frozenLeqs.mark(); ! ! for(Iterator i = constraints.iterator(); i.hasNext();) ! { ! Engine.Constraint k = (Engine.Constraint)i.next(); ! k.mark(); ! } } } *************** *** 127,144 **** public static void backtrack() { ! for(Iterator i = constraints.iterator(); ! i.hasNext();) ! { ! Engine.Constraint k = (Engine.Constraint)i.next(); ! k.backtrack(); } floating.backtrack(); soft.backtrack(); ! for(Iterator i = floating.iterator();i.hasNext();) ! ((Element)i.next()).setKind(null); ! floating.endOfIteration(); ! frozenLeqs.backtrack(); } public static void startSimplify() { --- 133,160 ---- public static void backtrack() { ! if (existentialLevel <= 1) ! { ! for(Iterator i = constraints.iterator(); ! i.hasNext();) ! { ! Engine.Constraint k = (Engine.Constraint) i.next(); ! k.backtrack(); ! } ! ! frozenLeqs.backtrack(); } + floating.backtrack(); soft.backtrack(); ! ! if (existentialLevel > 0) ! existentialLevel--; } + /** Marker used to know how deep we are inside existential mode, so that + we know when to exit from it. + */ + public static int existentialLevel = 0; + public static void startSimplify() { *************** *** 277,281 **** { if(dbg) Debug.println("Registering "+e); ! if(e.getKind()!=null) e.getKind().register(e); --- 293,301 ---- { if(dbg) Debug.println("Registering "+e); ! ! if (e.isExistential()) ! if (existentialLevel == 0) ! existentialLevel = 1; ! if(e.getKind()!=null) e.getKind().register(e); *************** *** 311,316 **** { Kind kind = e.getKind(); ! if(kind==null) ! throw new InternalError("null kind for "+e); Engine.Constraint k = getConstraint(kind); if(k==null) --- 331,337 ---- { Kind kind = e.getKind(); ! if(kind==null) ! return; ! //throw new InternalError("null kind for "+e); Engine.Constraint k = getConstraint(kind); if(k==null) *************** *** 381,386 **** { Kind kind = e.getKind(); ! if(kind==null) ! throw new InternalError("null kind for "+e); Engine.Constraint k = getConstraint(kind); if(k==null) --- 402,407 ---- { Kind kind = e.getKind(); ! if(kind==null) return e; ! //throw new InternalError("null kind for "+e); Engine.Constraint k = getConstraint(kind); if(k==null) *************** *** 421,425 **** { Element e = (Element)s.pop(); ! if(e.getKind()!=null) if(e.getKind()==k) --- 442,446 ---- { Element e = (Element)s.pop(); ! if(e.getKind()!=null) if(e.getKind()==k) *************** *** 546,549 **** --- 567,589 ---- try { + for(Iterator i = frozenLeqs.iterator(); i.hasNext();) + { + Leq leq = (Leq) i.next(); + Element e1 = leq.e1; + Element e2 = leq.e2; + + // If at least one of the two is existential, then we must + // keep + if (e1.isExistential()) + ((mlsub.typing.MonotypeVar) e2).setExistential(); + else if (e2.isExistential()) + ((mlsub.typing.MonotypeVar) e1).setExistential(); + } + } + finally{ + frozenLeqs.endOfIteration(); + } + + try { for(Iterator i = floating.iterator(); i.hasNext();) *************** *** 552,556 **** // useful for nullness head on monotype vars ! if (e.getKind() != null) continue; --- 592,598 ---- // useful for nullness head on monotype vars ! // we don't set existential in stone either, because they ! // might be put into a kind later on. ! if (e.getKind() != null || e.isExistential()) continue; *************** *** 570,574 **** --- 612,625 ---- { Leq leq = (Leq) i.next(); + Element e1 = leq.e1; + Element e2 = leq.e2; + + // By the above code, if e2 is existential, e1 was marked as + // existential too, so we don't need to test e2. + if (e1.isExistential()) + continue; + variablesConstraint.leq(leq.e1, leq.e2, initialContext); + i.remove(); } } *************** *** 576,580 **** frozenLeqs.endOfIteration(); } - frozenLeqs.clear(); } --- 627,630 ---- *************** *** 692,696 **** // this is not too logical to have this... ! public mlsub.typing.Monotype freshMonotype() { return null; --- 742,746 ---- // this is not too logical to have this... ! public mlsub.typing.Monotype freshMonotype(boolean existential) { return null; |
From: Daniel B. <bo...@us...> - 2004-03-17 17:05:01
|
Update of /cvsroot/nice/Nice/testsuite/compiler/statements/variables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19931/testsuite/compiler/statements/variables Modified Files: typeInference.testsuite Log Message: Do type inference on local bindings with polymorphic values. Index: typeInference.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/statements/variables/typeInference.testsuite,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** typeInference.testsuite 28 May 2003 09:04:59 -0000 1.2 --- typeInference.testsuite 17 Mar 2004 16:55:33 -0000 1.3 *************** *** 5,9 **** /// FAIL // An incorrect use of a polymorphic reference. ! let /* /// FAIL HERE */ l = new ArrayList(); l.add("Hello"); ! java.io.File f = l.get(0); --- 5,9 ---- /// FAIL // An incorrect use of a polymorphic reference. ! let l = new ArrayList(); l.add("Hello"); ! java.io.File /* /// FAIL HERE */ f = l.get(0); |
From: Daniel B. <bo...@us...> - 2004-03-17 00:46:10
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26138/src/bossa/syntax Modified Files: NiceMethod.java Log Message: Do not allow overriding involving specialization of type parameters, as this is unsafe since dispatch does not consider type parameters. Index: NiceMethod.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/NiceMethod.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** NiceMethod.java 16 Mar 2004 12:51:03 -0000 1.35 --- NiceMethod.java 17 Mar 2004 00:36:46 -0000 1.36 *************** *** 233,237 **** // Do we have a smaller domain? ! if (! (Typing.smaller(ourDomain, itsDomain, true))) continue; --- 233,238 ---- // Do we have a smaller domain? ! if (! (Typing.smaller(ourDomain, itsDomain, true)) ! || Types.typeParameterDispatch(getType(), s.getType())) continue; |
From: Daniel B. <bo...@us...> - 2004-03-17 00:46:10
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26138/testsuite/compiler/methods Modified Files: overriding.testsuite Log Message: Do not allow overriding involving specialization of type parameters, as this is unsafe since dispatch does not consider type parameters. Index: overriding.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/methods/overriding.testsuite,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** overriding.testsuite 3 Mar 2004 09:40:26 -0000 1.5 --- overriding.testsuite 17 Mar 2004 00:36:45 -0000 1.6 *************** *** 185,186 **** --- 185,216 ---- void foo(A a) {} override void foo(B b) {} + + /// PASS + /// Toplevel + <T> void foo(T x) {} + override void foo(String s) {} + + /// PASS + List<String> list = new ArrayList(); + list.add("abc"); + list.foo(); + /// Toplevel + <T> void foo(Collection<T> list) {} + // This is NOT an override + void foo(List<int> list) + { + int i = list[0]+1; + } + + /// FAIL + /// Toplevel + <T> void foo(Collection<T> list) {} + // This is NOT an override + override void foo(List<int> list) {} + + /// FAIL + /// Toplevel + class A<+T> {} + void foo(A<Object> x) {} + // This is NOT an override + override void foo(A<String> x) {} |
From: Daniel B. <bo...@us...> - 2004-03-17 00:46:10
|
Update of /cvsroot/nice/Nice/src/mlsub/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26138/src/mlsub/typing Modified Files: Typing.java Log Message: Do not allow overriding involving specialization of type parameters, as this is unsafe since dispatch does not consider type parameters. Index: Typing.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/Typing.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Typing.java 28 Feb 2004 14:23:43 -0000 1.35 --- Typing.java 17 Mar 2004 00:36:46 -0000 1.36 *************** *** 238,241 **** --- 238,261 ---- } + /** Assert that the vars are matching the base head constructors. */ + public static void leqHead(Monotype[] vars, Monotype[] base) + throws TypingEx + { + for (int i = 0; i < vars.length; i++) + { + Monotype var = vars[i]; + nice.tools.typing.Types.setMarkedKind(var); + nice.tools.typing.Types.setMarkedKind(base[i]); + + TypeConstructor baseMarker = base[i].head(); + if (baseMarker != null) + leq(var.head(), baseMarker); + + TypeConstructor tag = nice.tools.typing.Types.constructor(base[i]); + if (tag != null) + leq(nice.tools.typing.Types.equivalent(vars[i]), tag); + } + } + /**************************************************************** * Testing Polytype <= Polytype |
From: Daniel B. <bo...@us...> - 2004-03-17 00:46:07
|
Update of /cvsroot/nice/Nice/src/nice/tools/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26138/src/nice/tools/typing Modified Files: Types.java Log Message: Do not allow overriding involving specialization of type parameters, as this is unsafe since dispatch does not consider type parameters. Index: Types.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/typing/Types.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Types.java 2 Mar 2004 12:18:41 -0000 1.5 --- Types.java 17 Mar 2004 00:36:46 -0000 1.6 *************** *** 273,275 **** --- 273,324 ---- return true; } + + /** + @returns true if the spec type specializes type parameters of the original + type (which can not be checked at runtime during dispatch, and therefore + should not count as overriding). + */ + public static boolean typeParameterDispatch(Polytype spec, Polytype origin) + { + Monotype[] originalParams = parameters(origin); + + if (originalParams.length == 0) + return false; + + Typing.enter(); + try { + + try { + Polytype clonedSpec = spec.cloneType(); + + Constraint.enter(origin.getConstraint()); + Constraint.enter(clonedSpec.getConstraint()); + + // For all argument types ... + Monotype[] args = MonotypeVar.news(originalParams.length); + Typing.introduce(args); + + // ... that can be used for the first method ... + Typing.leq(args, originalParams); + + // ... and that will be dispatched to the specialized method ... + Typing.leqHead(args, parameters(clonedSpec)); + + Typing.implies(); + + // ... check that those args fit in the 'specialized' method ... + Constraint.enter(spec.getConstraint()); + Typing.leq(args, parameters(spec)); + } + finally { + Typing.leave(); + } + } + catch (TypingEx ex) { + return true; + } + + // OK, no covariant dispatch + return false; + } } |
From: Daniel B. <bo...@us...> - 2004-03-16 13:00:22
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22042/src/bossa/syntax Modified Files: NiceMethod.java Log Message: Give more precise information in case of contravariant overriding. Index: NiceMethod.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/NiceMethod.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** NiceMethod.java 15 Mar 2004 15:27:15 -0000 1.34 --- NiceMethod.java 16 Mar 2004 12:51:03 -0000 1.35 *************** *** 240,244 **** User.error (returnTypeLocation != null ? returnTypeLocation : location(), ! "The return type is less precise than the original return type defined in:\n" + d.location()); } --- 240,245 ---- User.error (returnTypeLocation != null ? returnTypeLocation : location(), ! "The return type is less precise than the original return type of method\n" + ! d + "\ndefined in:\n" + d.location()); } |
From: Daniel B. <bo...@us...> - 2004-03-16 11:24:15
|
Update of /cvsroot/nice/tester In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv392 Modified Files: Flow4j.test Log Message: Moved the flow4j sources to the nice website, where they can be updated Index: Flow4j.test =================================================================== RCS file: /cvsroot/nice/tester/Flow4j.test,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Flow4j.test 25 Jul 2003 14:11:31 -0000 1.4 --- Flow4j.test 16 Mar 2004 11:14:44 -0000 1.5 *************** *** 12,16 **** if [ ! -r flow4j ]; then if [ ! -r ${SOURCES} ]; then ! wget http://flow4j.sf.net/releases/${SOURCES} fi mkdir flow4j --- 12,16 ---- if [ ! -r flow4j ]; then if [ ! -r ${SOURCES} ]; then ! wget http://nice.sf.net/tests/${SOURCES} fi mkdir flow4j |
From: <bo...@us...> - 2004-03-15 15:36:23
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25068/src/bossa/syntax Modified Files: UserOperator.java NiceMethod.java Log Message: Put type parameters in the type scope of methods, in case the default values of formals parameters need it (anonymous functions for instance). Index: UserOperator.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/UserOperator.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** UserOperator.java 25 Feb 2004 11:23:28 -0000 1.9 --- UserOperator.java 15 Mar 2004 15:27:15 -0000 1.10 *************** *** 14,17 **** --- 14,18 ---- import nice.tools.code.Types; + import bossa.util.User; /** *************** *** 81,84 **** --- 82,101 ---- } + void resolve() + { + super.resolve(); + + // Adding the constraint in the type scope. It can be useful for + // the default values of the formal parameters + // (e.g. an anonymous function refering to a type parameter). + mlsub.typing.Constraint cst = getType().getConstraint(); + if (mlsub.typing.Constraint.hasBinders(cst)) + try { + typeScope.addSymbols(cst.binders()); + } catch (TypeScope.DuplicateName ex) { + User.error(this, "Double declaration of the same type parameter"); + } + } + public String toString() { Index: NiceMethod.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/NiceMethod.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** NiceMethod.java 5 Mar 2004 16:24:26 -0000 1.33 --- NiceMethod.java 15 Mar 2004 15:27:15 -0000 1.34 *************** *** 158,161 **** --- 158,163 ---- void resolve() { + super.resolve(); + homonyms = Node.getGlobalScope().lookup(getName()); homonyms.remove(getSymbol()); *************** *** 342,358 **** DefaultMethodImplementation implementation; - void resolve() - { - super.resolve(); - - mlsub.typing.Constraint cst = getType().getConstraint(); - if (mlsub.typing.Constraint.hasBinders(cst)) - try { - typeScope.addSymbols(cst.binders()); - } catch (TypeScope.DuplicateName ex) { - User.error(this, "Double declaration of the same type parameter"); - } - } - void innerTypecheck() throws TypingEx { --- 344,347 ---- |
From: <bo...@us...> - 2004-03-15 15:36:22
|
Update of /cvsroot/nice/Nice/testsuite/compiler/classes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25068/testsuite/compiler/classes Modified Files: fields.testsuite Log Message: Put type parameters in the type scope of methods, in case the default values of formals parameters need it (anonymous functions for instance). Index: fields.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/classes/fields.testsuite,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** fields.testsuite 5 Feb 2004 23:55:15 -0000 1.17 --- fields.testsuite 15 Mar 2004 15:27:15 -0000 1.18 *************** *** 159,160 **** --- 159,183 ---- /// package b import a {} + + + /// PASS + /// Toplevel + <T> void foo(T -> boolean f = (T e) => true); + foo(f) {} + + /// PASS + /// Toplevel + class StackImpl<T> { + private T -> boolean filter; + } + <T> new StackImpl(boolean v, T -> boolean f = (T e) => v) = + this(filter: f); + + /// PASS + /// package a + /// Toplevel + class StackImpl<T> { + private T -> boolean filter = (T e) => true; + } + /// package b import a + {} |
From: <bo...@us...> - 2004-03-15 12:15:12
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18417/src/bossa/syntax Modified Files: RetypedJavaMethod.java Log Message: Typos. Index: RetypedJavaMethod.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/RetypedJavaMethod.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** RetypedJavaMethod.java 26 Feb 2004 12:57:24 -0000 1.15 --- RetypedJavaMethod.java 15 Mar 2004 12:06:02 -0000 1.16 *************** *** 66,70 **** // We put this here, since we need 'module' to be computed // since it is used to open the imported packages. ! findReflectMethod(); super.buildScope(outer, typeOuter); --- 66,70 ---- // We put this here, since we need 'module' to be computed // since it is used to open the imported packages. ! findReflectMethod(); super.buildScope(outer, typeOuter); *************** *** 100,104 **** private Type[] javaArgType; ! public gnu.bytecode.Type javaReturnType() { return javaRetType; } --- 100,104 ---- private Type[] javaArgType; ! public gnu.bytecode.Type javaReturnType() { return javaRetType; } *************** *** 167,174 **** { if (methodName.equals("<init>")) ! setIgnoredRetyping(className, "Ignored retyping because class " + holder.getName() + " has no constructor with " + javaArgType.length + " arguments"); ! else setIgnoredRetyping(className, "Ignored retyping because no method named " + methodName + " with " + javaArgType.length + --- 167,174 ---- { if (methodName.equals("<init>")) ! setIgnoredRetyping(className, "Ignored retyping because class " + holder.getName() + " has no constructor with " + javaArgType.length + " arguments"); ! else setIgnoredRetyping(className, "Ignored retyping because no method named " + methodName + " with " + javaArgType.length + *************** *** 178,182 **** } ! setIgnoredRetyping(className, "Ignored retyping because The types of the arguments don't match the declaration:\n" + reflectMethod); --- 178,182 ---- } ! setIgnoredRetyping(className, "Ignored retyping because the types of the arguments don't match the declaration:\n" + reflectMethod); *************** *** 200,205 **** } else ! JavaClasses.registerNativeMethod(this, reflectMethod); ! int javaArity; if(reflectMethod.getStaticFlag() || reflectMethod.isConstructor()) --- 200,205 ---- } else ! JavaClasses.registerNativeMethod(this, reflectMethod); ! int javaArity; if(reflectMethod.getStaticFlag() || reflectMethod.isConstructor()) *************** *** 207,211 **** else javaArity = javaTypes.size(); ! if(javaTypes != null && javaArity != arity) User.error(this, --- 207,211 ---- else javaArity = javaTypes.size(); ! if(javaTypes != null && javaArity != arity) User.error(this, |
From: <fb...@us...> - 2004-03-14 14:58:35
|
Update of /cvsroot/nice/Nice/src/nice/tools/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13535 Modified Files: api.nice htmlwriter.nice main.nice Log Message: api.nice has suffered only some spelling corrections in the comments. main.nice has had very minor changes to comments and printlns to the user. htmlwriter.nice has a much more comprehensive function to convert a string for html veiwing. Some comments have also been updated. Index: api.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/doc/api.nice,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** api.nice 14 Feb 2004 12:40:57 -0000 1.2 --- api.nice 14 Mar 2004 14:49:36 -0000 1.3 *************** *** 35,39 **** // We want to "recompile" that is, load from source, all available ! // packages, so that we can geenrate documentation for them. compilation.recompileAll = true; --- 35,39 ---- // We want to "recompile" that is, load from source, all available ! // packages, so that we can generate documentation for them. compilation.recompileAll = true; *************** *** 52,54 **** // There was an error. Stop working. } ! } --- 52,54 ---- // There was an error. Stop working. } ! } \ No newline at end of file Index: htmlwriter.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/doc/htmlwriter.nice,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** htmlwriter.nice 17 Feb 2004 12:13:02 -0000 1.3 --- htmlwriter.nice 14 Mar 2004 14:49:36 -0000 1.4 *************** *** 183,190 **** } void write(List<bossa.modules.Package> packages) { try { ! BufferedWriter writer = new BufferedWriter ! (new FileWriter(new File(outdir, "index.html"))); writer.write(getHeader("Packages")); writer.write("<b>Packages:</b>\n"); --- 183,193 ---- } + /** This method takes a List containing all the packages that are going to be + * documented. It writes a page at the root of output dir called index.html + * containing a list of hyperlinks to all the packages. + */ void write(List<bossa.modules.Package> packages) { try { ! BufferedWriter writer = new BufferedWriter(new FileWriter(new File(outdir, "index.html"))); writer.write(getHeader("Packages")); writer.write("<b>Packages:</b>\n"); *************** *** 203,212 **** /** Converts a String that may contain characters such as '<' to one that will display ! * properly in html */ String htmlSafe(String s) { ! return ! nice.tools.util.JDK.replaceAll ! (nice.tools.util.JDK.replaceAll(s, "<", "<"), ">", ">"); } --- 206,263 ---- /** Converts a String that may contain characters such as '<' to one that will display ! * properly in html. Submitted by S. Bayer to http://www.rgagnon.com/javadetails/java-0306.html. */ String htmlSafe(String s) { ! StringBuffer sb = new StringBuffer(s.length()); ! //true if last char was blank - this is for handling non-breaking spaces ! boolean lastWasBlankChar = false; ! ! for (int i = 0; i < s.length(); i++) { ! char c = s.charAt(i); ! if (c == ' ') { ! // blank gets extra work, ! // this solves the problem you get if you replace all ! // blanks with , if you do that you lose ! // word breaking ! if (lastWasBlankChar) { ! lastWasBlankChar = false; ! sb.append(" "); ! } ! else { ! lastWasBlankChar = true; ! sb.append(' '); ! } ! } ! else { ! lastWasBlankChar = false; ! // HTML Special Chars ! if (c == '"') ! sb.append("""); ! else if (c == '&') ! sb.append("&"); ! else if (c == '<') ! sb.append("<"); ! else if (c == '>') ! sb.append(">"); ! else if (c == '\n') ! // Handle Newline ! sb.append("<br/>"); ! else { ! //char and int or not related in nice, so we can't do a direct cast ! //hence, we use int(c) instead of (int)c ! int ci = 0xffff & int(c); ! if(ci < 160) ! // nothing special only 7 Bit ! sb.append(c); ! else { ! // Not 7 Bit use the unicode system ! sb.append("&#"); ! sb.append(new Integer(ci).toString()); ! sb.append(';'); ! } ! } ! } ! } ! return sb.toString(); } *************** *** 235,237 **** "</body>\n" + "</html>\n"; ! } --- 286,288 ---- "</body>\n" + "</html>\n"; ! } \ No newline at end of file Index: main.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/doc/main.nice,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** main.nice 16 Feb 2004 15:08:30 -0000 1.4 --- main.nice 14 Mar 2004 14:49:36 -0000 1.5 *************** *** 4,8 **** API documentation generator for Nice. ! @author ? */ --- 4,8 ---- API documentation generator for Nice. ! @author Francis Barber */ *************** *** 25,29 **** (name: "nicedoc", longName: "The Nice Documentation Generator", shortDescription: "Documentation Generator for the Nice programming language", ! author: "Daniel Bonniot <bo...@us...>", seeAlso: "http://nice.sourceforge.net the Nice Home Page\n" + "http://nice.sf.net/compilation.html compilation instructions\n", --- 25,30 ---- (name: "nicedoc", longName: "The Nice Documentation Generator", shortDescription: "Documentation Generator for the Nice programming language", ! author: "Daniel Bonniot <bo...@us...>\n" + ! "Francis Barber <fb...@us...>", seeAlso: "http://nice.sourceforge.net the Nice Home Page\n" + "http://nice.sf.net/compilation.html compilation instructions\n", *************** *** 64,68 **** if (rest.size() > 1) println("Supply only one package on the command line.\n" + ! "nicec will automatically find dependancies."); usage(prg, ERROR); } --- 65,69 ---- if (rest.size() > 1) println("Supply only one package on the command line.\n" + ! "nicecdoc will automatically find dependancies."); usage(prg, ERROR); } *************** *** 77,79 **** generate(compilation, mainPackage, outdir); ! } --- 78,80 ---- generate(compilation, mainPackage, outdir); ! } \ No newline at end of file |
From: <bo...@us...> - 2004-03-09 12:48:48
|
Update of /cvsroot/nice/Nice/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1711/web Modified Files: new.xsl Log Message: Link to the GetInvolved wiki page. Index: new.xsl =================================================================== RCS file: /cvsroot/nice/Nice/web/new.xsl,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** new.xsl 9 Dec 2003 18:25:45 -0000 1.15 --- new.xsl 9 Mar 2004 12:31:33 -0000 1.16 *************** *** 200,203 **** --- 200,206 ---- <a class="nav" href="http://sourceforge.net/cvs/?group_id=12788">CVS</a> <br /> + <span class="small">o</span><xsl:text> </xsl:text> + <a class="nav" href="http://nice.sourceforge.net/cgi-bin/twiki/view/Doc/GetInvolved">Contribute!</a> + <br /> </td> </tr> |
From: <bo...@us...> - 2004-03-09 12:42:58
|
Update of /cvsroot/nice/Nice/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv559/web Modified Files: index.xml Log Message: Expanded some descriptions of the benefits (multi-methods, named arguments). Index: index.xml =================================================================== RCS file: /cvsroot/nice/Nice/web/index.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** index.xml 2 Mar 2004 15:18:59 -0000 1.8 --- index.xml 9 Mar 2004 12:25:48 -0000 1.9 *************** *** 49,53 **** Ever got bored of writing tons of loops, casts, overloaded methods with default ! values, ... ? </para> </listitem> --- 49,53 ---- Ever got bored of writing tons of loops, casts, overloaded methods with default ! values, anonymous classes, ... ? </para> </listitem> *************** *** 87,90 **** --- 87,95 ---- This means that new methods can be defined on classes that belong to a different package (even in java.*). + This allows for a more modular style: you don't need to pack classes with + all possibly useful methods, but you can split them into several packages + dealing with different aspects. Development can then happen independently + if each package. + </para><para> Multi-methods also extend usual methods with the possibility to dispatch on every argument, instead of only the receiver class. *************** *** 97,102 **** <varlistentry><term>Tuples</term><listitem><para> ! This allows in particular methods to return ! several values. </para> </listitem> --- 102,106 ---- <varlistentry><term>Tuples</term><listitem><para> ! This allows in particular methods to return several values. </para> </listitem> *************** *** 108,112 **** is not present in the call. This is much simpler than in Java, where one has to write several versions of the method for each combination of ! parameters. </para> </listitem> --- 112,117 ---- is not present in the call. This is much simpler than in Java, where one has to write several versions of the method for each combination of ! parameters. The names of the arguments can also be specified at the call ! site, improving readability and making argument order irrelevant. </para> </listitem> *************** *** 153,155 **** </section> ! </page> \ No newline at end of file --- 158,160 ---- </section> ! </page> |
From: <bo...@us...> - 2004-03-09 11:53:25
|
Update of /cvsroot/nice/Nice/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21955/web Modified Files: .htaccess Log Message: Released 0.9.7 Index: .htaccess =================================================================== RCS file: /cvsroot/nice/Nice/web/.htaccess,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** .htaccess 27 Feb 2004 15:31:58 -0000 1.17 --- .htaccess 9 Mar 2004 11:36:17 -0000 1.18 *************** *** 1,6 **** Redirect /Wiki http://nice.sourceforge.net/cgi-bin/twiki/view ! Redirect /Nice.tar http://prdownloads.sourceforge.net/nice/Nice-0.9.6-unix.tar.gz ! Redirect /Nice-source.tar.gz http://prdownloads.sourceforge.net/nice/Nice-0.9.6-source.tar.gz ! Redirect /Nice.zip http://prdownloads.sourceforge.net/nice/Nice-0.9.6-windows.zip ! Redirect /nice.deb http://prdownloads.sourceforge.net/nice/nice_0.9.6-1_all.deb ! Redirect /nice.rpm http://prdownloads.sourceforge.net/nice/Nice-0.9.6-1.noarch.rpm --- 1,6 ---- Redirect /Wiki http://nice.sourceforge.net/cgi-bin/twiki/view ! Redirect /Nice.tar http://prdownloads.sourceforge.net/nice/Nice-0.9.7-unix.tar.gz ! Redirect /Nice-source.tar.gz http://prdownloads.sourceforge.net/nice/Nice-0.9.7-source.tar.gz ! Redirect /Nice.zip http://prdownloads.sourceforge.net/nice/Nice-0.9.7-windows.zip ! Redirect /nice.deb http://prdownloads.sourceforge.net/nice/nice_0.9.7-1_all.deb ! Redirect /nice.rpm http://prdownloads.sourceforge.net/nice/Nice-0.9.7-1.noarch.rpm |
From: <bo...@us...> - 2004-03-09 10:57:42
|
Update of /cvsroot/nice/Nice/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11548/web Modified Files: install.xml Log Message: Added eclipse plugin. Mentioned that Nice is now in Debian. Index: install.xml =================================================================== RCS file: /cvsroot/nice/Nice/web/install.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** install.xml 20 Feb 2004 10:31:10 -0000 1.12 --- install.xml 9 Mar 2004 10:40:35 -0000 1.13 *************** *** 12,16 **** </description> ! <keywords>nice, compiler, install, windows, debian, linux, unix</keywords> <para> --- 12,18 ---- </description> ! <keywords> ! nice, compiler, install, windows, debian, linux, unix, eclipse ! </keywords> <para> *************** *** 21,24 **** --- 23,35 ---- <listitem><para> <inlinemediaobject><imageobject> + <imagedata fileref="images/eclipse.png"/> + </imageobject></inlinemediaobject> + + <link linkend="eclipse">Eclipse</link> + + </para></listitem> + <listitem><para> + + <inlinemediaobject><imageobject> <imagedata fileref="images/debian.png"/> </imageobject></inlinemediaobject> *************** *** 81,87 **** <section id="deb"><title>Debian Linux</title> <para> ! Simply download the <ulink url="nice.deb">Debian package</ulink> and install it with <literal>dpkg -i nice_*.deb</literal>. </para> --- 92,114 ---- + <section id="eclipse"><title>Eclipse</title> + <para> + Nice can be installed inside the + <ulink url="http://eclipse.org">eclipse</ulink> development platform. + Download the <ulink + url="http://sf.net/project/showfiles.php?group_id=12788&package_id=94229"> + plugin zip file</ulink>, and unzip it inside the <literal>plugins</literal> + sub-directory of your eclipse directory. + The Nice plugin works for versions 2.1 and 3.0 of eclipse, and it includes + the Nice compiler, so you don't need to install it separately. + </para> + </section> + <section id="deb"><title>Debian Linux</title> <para> ! Nice is in the Debian archive, so you can ! simply <literal>apt-get install nice</literal>. ! Alternatively, you can download the ! <ulink url="nice.deb">Debian package</ulink> from this site and install it with <literal>dpkg -i nice_*.deb</literal>. </para> |
From: <bo...@us...> - 2004-03-08 18:36:22
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14606/debian Modified Files: changelog Log Message: 0.9.7 Index: changelog =================================================================== RCS file: /cvsroot/nice/Nice/debian/changelog,v retrieving revision 1.237 retrieving revision 1.238 diff -C2 -d -r1.237 -r1.238 *** changelog 20 Feb 2004 15:36:11 -0000 1.237 --- changelog 8 Mar 2004 18:19:46 -0000 1.238 *************** *** 1,2 **** --- 1,8 ---- + nice (0.9.7-1) unstable; urgency=low + + * New upstream version. + + -- Daniel Bonniot <bo...@us...> Mon, 8 Mar 2004 19:12:41 +0100 + nice (0.9.6-1) unstable; urgency=low |