nice-commit Mailing List for The Nice Programming Language (Page 123)
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-03-11 17:20:32
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1:/tmp/cvs-serv27788 Added Files: ForInIters.nice Log Message: internal iterators for the new forloop --- NEW FILE: ForInIters.nice --- package nice.lang; //the interface used in for in public interface ForInIterator<E> { boolean next(); E current(); } //Methods that returns a ForInIterator interface for iteration over a particular class. //If a "for in" is wanted for another class is could easily be added. <E> ForInIterator<E> forInIterator(Collection<E> c) = new CollectionForInIter(iter: c.iterator()); <E> ForInIterator<E> forInIterator(E[] arr) = new ArrayForInIter(arr: arr); ForInIterator<char> forInIterator(String s) = new StringForInIter(str: s); ForInIterator<char> forInIterator(StringBuffer sb) = new StringBufferForInIter(strb: sb); //temporaly left out because of retyping //<K, V> Set<K> keySet(Map<K,V>) = native Set Map.keySet(); //<K,V> ForInIterator<K> forInIterator(Map<K ,V> m) = new CollectionForInIter(iter: m.keySet().iterator()); //The implementations of specific ForInIterators private class CollectionForInIter<E> implements ForInIterator<E>{ Iterator<E> iter; next() = iter.hasNext(); current() = iter.next(); } private class ArrayForInIter<E> implements ForInIterator<E>{ E[] arr; int pos = -1; next() = ++pos<arr.length; current() = arr[pos]; } private class StringForInIter<E | E <: char, char <: E> implements ForInIterator<E>{ String str; int pos = -1; next() = ++pos<str.length(); current() = str.charAt(pos); } private class StringBufferForInIter<E | E <: char, char <: E> implements ForInIterator<E>{ StringBuffer strb; int pos = -1; next() = ++pos<strb.length(); current() = strb.charAt(pos); } |
From: <ar...@us...> - 2003-03-11 17:19:35
|
Update of /cvsroot/nice/Nice/testsuite/compiler/statements/loops In directory sc8-pr-cvs1:/tmp/cvs-serv27165 Added Files: newforloop.testsuite Log Message: testsuite for new forloop --- NEW FILE: newforloop.testsuite --- /// PASS List<int> a = new ArrayList(); a.add(5);a.add(4);a.add(3);a.add(2);a.add(1); int x = 0; for(int i : a) { if (i==4) continue; x += i; if (i==2) break; } assert(x == 10); /// PASS String[] arr = ["a","bc","def","ghij","klmno"]; String t = ""; for (String s : arr) t+=s; assert(t.equals("abcdefghijklmno")); /// PASS String[] arr = ["a","bc","def","ghij","klmno"]; String t = ""; for(String s : arr) for(char c : s) t+=c; assert(t.equals("abcdefghijklmno")); /// PASS int[][] array2 = [[1,2],[3,4]]; int j = 0; for(int[] array3 : array2) for(int i : array3) j+=i; assert(j==10); |
From: <ar...@us...> - 2003-03-11 17:14:45
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1:/tmp/cvs-serv24309a/F:/nice/src/bossa/parser Modified Files: Parser.jj Log Message: Added the 'for in' loop. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.147 retrieving revision 1.148 diff -C2 -d -r1.147 -r1.148 *** Parser.jj 8 Mar 2003 13:32:14 -0000 1.147 --- Parser.jj 11 Mar 2003 17:14:38 -0000 1.148 *************** *** 2532,2550 **** Statement ForStatement() : ! { Statement init=null,update=null,body,loop; Expression cond=null; } { ! "for" "(" ( init=ForInit() | ";" ) [ cond=Expression() ] ";" [ update=StatementExpressionList() ] ")" body=Statement() ! { ! loop=LoopStmt.forLoop(cond,update,body); ! if(init==null) ! return loop; ! List l = new LinkedList(); ! l.add(init); ! l.add(loop); ! return new Block(l); ! } } --- 2532,2564 ---- Statement ForStatement() : ! { Statement init=null,update=null,body,loop,block; Expression cond=null; } { ! "for" "(" ! ( ! LOOKAHEAD( monotype() <IDENT> ":" ) block=ForInStatement() ! | ! ( init=ForInit() | ";" ) [ cond=Expression() ] ";" [ update=StatementExpressionList() ] ")" body=Statement() ! { ! loop=LoopStmt.forLoop(cond,update,body); ! if(init==null) ! return loop; ! ! List l = new LinkedList(); ! l.add(init); ! l.add(loop); ! block = new Block(l); ! } ! ) ! { return block; } ! } ! Statement ForInStatement() : ! { Statement body; Monotype vartype; LocatedString var; Expression container; Token t; } ! { ! vartype=monotype() var=ident() t=":" container=Expression() ")" ! body=Statement() ! {return LoopStmt.forInLoop(vartype,var,new Location(t),container,body); } } |
From: <ar...@us...> - 2003-03-11 17:14:45
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv24309a/F:/nice/src/bossa/syntax Modified Files: LoopStmt.java Log Message: Added the 'for in' loop. Index: LoopStmt.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/LoopStmt.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** LoopStmt.java 25 Jul 2002 13:33:12 -0000 1.9 --- LoopStmt.java 11 Mar 2003 17:14:38 -0000 1.10 *************** *** 42,45 **** --- 42,75 ---- } + public static Statement forInLoop(Monotype vartype, LocatedString var, Location loc, Expression container, Statement body) + { + Monotype itertype; + LocatedString iter; + Expression getiter,iterexp,cond,getvar; + Statement loop,init,assign; + + List tparams = new ArrayList(1); + tparams.add(vartype); + itertype = new MonotypeConstructor(new TypeIdent(new LocatedString("ForInIterator", loc)), + new TypeParameters(tparams), loc); + itertype.nullness = Monotype.sure; + getiter = CallExp.create(new IdentExp(new LocatedString("forInIterator", loc)), container); + iter = new LocatedString("for_in_iter", loc); + init = new Block.LocalVariable(iter, itertype, true, getiter); + iterexp = new IdentExp(iter); + cond = CallExp.create(new IdentExp(new LocatedString("next", loc)), iterexp); + getvar = CallExp.create(new IdentExp(new LocatedString("current", loc)), iterexp); + assign = new Block.LocalVariable(var, vartype, false, getvar); + List loopbody = new LinkedList(); + loopbody.add(assign); + loopbody.add(body); + loop = LoopStmt.whileLoop(cond, new Block(loopbody)); + List l = new LinkedList(); + l.add(init); + l.add(loop); + return new Block(l); + + } + /** * Create a loop statement. |
From: <bo...@us...> - 2003-03-08 14:40:13
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1:/tmp/cvs-serv15803/src/bossa/parser Modified Files: Loader.java Log Message: Catch and report nicely unterminated multi-line comments. Index: Loader.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Loader.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Loader.java 11 Nov 2002 20:14:51 -0000 1.17 --- Loader.java 8 Mar 2003 14:27:12 -0000 1.18 *************** *** 75,78 **** --- 75,84 ---- User.error(e.getMessage()); } + catch(TokenMgrError e) { + String message = e.getMessage(); + if (message.indexOf("<EOF>") != -1) + message = "Unexpected end of file"; + User.error(Location.nowhere(), message); + } } finally { |
From: <bo...@us...> - 2003-03-08 14:40:04
|
Update of /cvsroot/nice/Nice/testsuite/compiler/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv15803/testsuite/compiler/syntax Added Files: comments.testsuite Log Message: Catch and report nicely unterminated multi-line comments. --- NEW FILE: comments.testsuite --- /// FAIL /* Untermintated comment! |
From: <bo...@us...> - 2003-03-08 13:32:17
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1:/tmp/cvs-serv24707/src/bossa/parser Modified Files: Parser.jj Log Message: Allow single line comments without a newline at the end of the file. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.146 retrieving revision 1.147 diff -C2 -d -r1.146 -r1.147 *** Parser.jj 6 Mar 2003 12:29:07 -0000 1.146 --- Parser.jj 8 Mar 2003 13:32:14 -0000 1.147 *************** *** 73,78 **** MORE : { - "//" : IN_SINGLE_LINE_COMMENT - | <"/**" ~["/"]> { input_stream.backup(1); } : IN_FORMAL_COMMENT | --- 73,76 ---- *************** *** 80,88 **** } ! <IN_SINGLE_LINE_COMMENT> ! SPECIAL_TOKEN : ! { ! <SINGLE_LINE_COMMENT: "\n" | "\r" | "\r\n" > : DEFAULT ! } <IN_FORMAL_COMMENT> --- 78,83 ---- } ! SPECIAL_TOKEN : ! { <SINGLE_LINE_COMMENT: "//" (~["\n", "\r"])* ("\n" | "\r" | "\r\n" )? > } <IN_FORMAL_COMMENT> *************** *** 98,102 **** } ! <IN_SINGLE_LINE_COMMENT,IN_FORMAL_COMMENT,IN_MULTI_LINE_COMMENT> MORE : { --- 93,97 ---- } ! <IN_FORMAL_COMMENT,IN_MULTI_LINE_COMMENT> MORE : { |
From: <bo...@us...> - 2003-03-08 13:32:17
|
Update of /cvsroot/nice/Nice/regtest/basic In directory sc8-pr-cvs1:/tmp/cvs-serv24707/regtest/basic Modified Files: syntax.nice Log Message: Allow single line comments without a newline at the end of the file. Index: syntax.nice =================================================================== RCS file: /cvsroot/nice/Nice/regtest/basic/syntax.nice,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** syntax.nice 20 Feb 2003 11:16:14 -0000 1.6 --- syntax.nice 8 Mar 2003 13:32:14 -0000 1.7 *************** *** 31,32 **** --- 31,37 ---- class Character { int dummy; } int get(Character other) = other.dummy; + + + + + // We put this comment on the last line, without a trailing newline. \ No newline at end of file |
From: <ag...@us...> - 2003-03-07 15:29:06
|
Update of /cvsroot/nice/Nice/web In directory sc8-pr-cvs1:/tmp/cvs-serv10040a/web Modified Files: new.xsl Log Message: changed the link to wiki Index: new.xsl =================================================================== RCS file: /cvsroot/nice/Nice/web/new.xsl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** new.xsl 2 Jul 2002 14:59:19 -0000 1.4 --- new.xsl 7 Mar 2003 15:29:02 -0000 1.5 *************** *** 130,134 **** <td bgcolor="#ffffff"> <span class="small">o</span><xsl:text> </xsl:text> ! <a class="nav" href="Wiki">Collaborative site (Wiki)</a> <br /> <span class="small">o</span><xsl:text> </xsl:text> --- 130,137 ---- <td bgcolor="#ffffff"> <span class="small">o</span><xsl:text> </xsl:text> ! <!-- <a class="nav" href="Wiki">Collaborative site (Wiki)</a>--> ! <span class="nav">Wiki </span> ! <a class="nav" href="/cgi-bin/twiki/view/Dev/WebHome">Dev</a> ! <a class="nav" href="/cgi-bin/twiki/view/Doc/WebHome">Doc</a> <br /> <span class="small">o</span><xsl:text> </xsl:text> |
From: <bo...@us...> - 2003-03-06 12:40:06
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1:/tmp/cvs-serv22314/src/bossa/parser Modified Files: Parser.jj Log Message: Allow ?(T[]) syntax for optional arrays, as an alternative to T[?]. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.145 retrieving revision 1.146 diff -C2 -d -r1.145 -r1.146 *** Parser.jj 25 Feb 2003 20:08:00 -0000 1.145 --- Parser.jj 6 Mar 2003 12:29:07 -0000 1.146 *************** *** 794,798 **** new TypeParameters(tp), loc); ! res.nullness = maybe ? res.maybe : res.sure; } ] --- 794,798 ---- new TypeParameters(tp), loc); ! res.nullness = maybe ? res.maybe : res.absent; } ] |
From: <bo...@us...> - 2003-03-06 12:40:05
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1:/tmp/cvs-serv22314/debian Modified Files: changelog Log Message: Allow ?(T[]) syntax for optional arrays, as an alternative to T[?]. Index: changelog =================================================================== RCS file: /cvsroot/nice/Nice/debian/changelog,v retrieving revision 1.135 retrieving revision 1.136 diff -C2 -d -r1.135 -r1.136 *** changelog 5 Mar 2003 12:33:54 -0000 1.135 --- changelog 6 Mar 2003 12:29:07 -0000 1.136 *************** *** 1,2 **** --- 1,8 ---- + nice (0.7.8) unstable; urgency=low + + * Allow ?(T[]) syntax for optional arrays, as an alternative to T[?]. + + -- + nice (0.7.7) unstable; urgency=low |
From: <bo...@us...> - 2003-03-06 12:39:15
|
Update of /cvsroot/nice/Nice/testsuite/compiler/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv22314/testsuite/compiler/syntax Modified Files: types.testsuite Log Message: Allow ?(T[]) syntax for optional arrays, as an alternative to T[?]. Index: types.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/syntax/types.testsuite,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** types.testsuite 7 Oct 2002 12:34:32 -0000 1.4 --- types.testsuite 6 Mar 2003 12:29:07 -0000 1.5 *************** *** 63,64 **** --- 63,89 ---- /// package b import a f((65536,1)); + + /// PASS + ?(String[]) s1; + s1 = null; + s1 = [ "A" ]; + + String[?] s1'; + s1' = null; + s1' = [ "A" ]; + + (?String)[] s2; + s2 = [ null ]; + s2 = [ "A" ]; + + ?String[] s2'; + s2' = [ null ]; + s2' = [ "A" ]; + + ?(?String[]) s3; + s3 = null; + s3 = [ null ]; + + ?String[?] s3'; + s3' = null; + s3' = [ null ]; |
From: <bo...@us...> - 2003-03-06 12:30:23
|
Update of /cvsroot/nice/Nice/web In directory sc8-pr-cvs1:/tmp/cvs-serv22931/web Modified Files: .htaccess Log Message: Release 0.7.7 Index: .htaccess =================================================================== RCS file: /cvsroot/nice/Nice/web/.htaccess,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** .htaccess 10 Feb 2003 12:17:57 -0000 1.5 --- .htaccess 6 Mar 2003 12:30:19 -0000 1.6 *************** *** 1,5 **** Redirect /Wiki http://nice.sourceforge.net/cgi-bin/twiki/view ! Redirect /Nice.tar http://prdownloads.sourceforge.net/nice/Nice-0.7.6.tar ! Redirect /Nice.zip http://prdownloads.sourceforge.net/nice/Nice-0.7.6-windows.zip ! Redirect /nice.deb http://prdownloads.sourceforge.net/nice/nice_0.7.6_all.deb ! Redirect /nice.rpm http://prdownloads.sourceforge.net/nice/Nice-0.7.6-1.noarch.rpm --- 1,5 ---- Redirect /Wiki http://nice.sourceforge.net/cgi-bin/twiki/view ! Redirect /Nice.tar http://prdownloads.sourceforge.net/nice/Nice-0.7.7.tar ! Redirect /Nice.zip http://prdownloads.sourceforge.net/nice/Nice-0.7.7-windows.zip ! Redirect /nice.deb http://prdownloads.sourceforge.net/nice/nice_0.7.7_all.deb ! Redirect /nice.rpm http://prdownloads.sourceforge.net/nice/Nice-0.7.7-1.noarch.rpm |
From: <bo...@us...> - 2003-03-06 01:47:27
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv31458/src/bossa/syntax Modified Files: Block.java Log Message: Do not assign a default value to local variables without initializers. The compiler already guarantees that they will be assigned before use anyway. Index: Block.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Block.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** Block.java 19 Feb 2003 21:56:30 -0000 1.52 --- Block.java 6 Mar 2003 01:47:23 -0000 1.53 *************** *** 69,72 **** --- 69,74 ---- if (! getSymbol().isAssignable()) decl.setFlag(gnu.expr.Declaration.IS_CONSTANT); + if (value == null) + decl.setFlag(gnu.expr.Declaration.NOT_INITIALIZED); getSymbol().setDeclaration(decl); *************** *** 136,140 **** { if (value == null) ! return Types.defaultValue(left.type); else return value.generateCode(); --- 138,142 ---- { if (value == null) ! return gnu.expr.QuoteExp.undefined_exp; else return value.generateCode(); |
From: <bo...@us...> - 2003-03-06 01:47:26
|
Update of /cvsroot/nice/Nice/src/gnu/expr In directory sc8-pr-cvs1:/tmp/cvs-serv31458/src/gnu/expr Modified Files: Declaration.java Log Message: Do not assign a default value to local variables without initializers. The compiler already guarantees that they will be assigned before use anyway. Index: Declaration.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/Declaration.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Declaration.java 27 Nov 2002 17:56:08 -0000 1.8 --- Declaration.java 6 Mar 2003 01:47:18 -0000 1.9 *************** *** 196,201 **** public static final int IS_SINGLE_VALUE = 0x40000; ! public static final int TRANSIENT = 0x40000; ! public static final int VOLATILE = 0x80000; protected int flags = IS_SIMPLE; --- 196,203 ---- public static final int IS_SINGLE_VALUE = 0x40000; ! public static final int TRANSIENT = 0x80000; ! public static final int VOLATILE = 0x100000; ! ! public static final int NOT_INITIALIZED = 0x200000; protected int flags = IS_SIMPLE; *************** *** 313,317 **** // This is a kludge. Ideally, we should do some data-flow analysis. // But at least it makes sure require'd variables are not initialized. ! return ! ignorable() && ! (value == QuoteExp.nullExp && base != null); } --- 315,320 ---- // This is a kludge. Ideally, we should do some data-flow analysis. // But at least it makes sure require'd variables are not initialized. ! return ! getFlag(NOT_INITIALIZED) ! && ! ignorable() && ! (value == QuoteExp.nullExp && base != null); } |
From: <bo...@us...> - 2003-03-06 01:47:24
|
Update of /cvsroot/nice/Nice/testsuite/compiler/statements/variables In directory sc8-pr-cvs1:/tmp/cvs-serv31458/testsuite/compiler/statements/variables Added Files: bytecode.testsuite Log Message: Do not assign a default value to local variables without initializers. The compiler already guarantees that they will be assigned before use anyway. --- NEW FILE: bytecode.testsuite --- /// PASS assert foo([1.0,2.0], true) == 1.0; /// Toplevel <Any T | T <: double, int <: T > T foo(T[] a, boolean first) { T res; if (first) res = a[0]; else res = a[1]; return res; } /// PASS ?String foo = null; assert foo == null; |
From: <bo...@us...> - 2003-03-06 01:39:21
|
Update of /cvsroot/nice/Nice/testsuite/compiler/statements/variables In directory sc8-pr-cvs1:/tmp/cvs-serv29117/testsuite/compiler/statements/variables Log Message: Directory /cvsroot/nice/Nice/testsuite/compiler/statements/variables added to the repository |
From: <bo...@us...> - 2003-03-06 00:50:10
|
Update of /cvsroot/nice/Nice/testsuite/compiler/expressions/arrays In directory sc8-pr-cvs1:/tmp/cvs-serv13625/testsuite/compiler/expressions/arrays Modified Files: compilation.testsuite Log Message: Fixes setting to an array whose component type is not known precisely, but is constrained below some primitive type. Index: compilation.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/expressions/arrays/compilation.testsuite,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** compilation.testsuite 12 Feb 2003 12:47:46 -0000 1.2 --- compilation.testsuite 6 Mar 2003 00:50:06 -0000 1.3 *************** *** 16,20 **** assert t.a instanceof Item[]; ! // Check that the array is not copied to arrabge the types, which would // discard the side-effect. t.a[0] = new Item(); --- 16,20 ---- assert t.a instanceof Item[]; ! // Check that the array is not copied to arrange the types, which would // discard the side-effect. t.a[0] = new Item(); *************** *** 28,29 **** --- 28,39 ---- // its bytecode type not yet known. class Item {} + + /// PASS + double[] d = [ 0, 1 ]; + heapsort(d); + assert d[1] == 0; + /// Toplevel + <Any T | T <: double, int <: T > + void heapsort(T[] ra) { + ra[1] = ra[0]; + } |
From: <bo...@us...> - 2003-03-06 00:50:10
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang/inline In directory sc8-pr-cvs1:/tmp/cvs-serv13625/stdlib/nice/lang/inline Modified Files: ArraySetOp.java Log Message: Fixes setting to an array whose component type is not known precisely, but is constrained below some primitive type. Index: ArraySetOp.java =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/inline/ArraySetOp.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ArraySetOp.java 26 Nov 2001 15:31:49 -0000 1.3 --- ArraySetOp.java 6 Mar 2003 00:50:07 -0000 1.4 *************** *** 39,47 **** { this.type = type; - arrayTarget = new StackTarget(nice.tools.code.SpecialTypes.array(type)); } private final Type type; - private final StackTarget arrayTarget; public void compile (ApplyExp exp, Compilation comp, Target target) --- 39,45 ---- *************** *** 49,65 **** Expression[] args = exp.getArgs(); CodeAttr code = comp.getCode(); ! ! args[0].compile(comp, arrayTarget); boolean bytecodeArray = Tools.monomorphicArray(code.topType()); args[1].compile(comp, Tools.intTarget); ! args[2].compile(comp, type); if (bytecodeArray) ! code.emitArrayStore(type); else ! code.emitInvokeStatic(reflectGet); } ! private static Method reflectGet = ClassType.make("java.lang.reflect.Array").getDeclaredMethod("set", 3); --- 47,71 ---- Expression[] args = exp.getArgs(); CodeAttr code = comp.getCode(); ! ! args[0].compile(comp, Target.pushObject); boolean bytecodeArray = Tools.monomorphicArray(code.topType()); args[1].compile(comp, Tools.intTarget); ! ! Type componentType = type; ! // Try to get bytecode type information from the target array. ! if (type == Type.pointer_type) ! try { ! componentType = ((ArrayType) args[0].getType()).getComponentType(); ! } ! catch (ClassCastException ex) {} ! args[2].compile(comp, componentType); if (bytecodeArray) ! code.emitArrayStore(componentType); else ! code.emitInvokeStatic(reflectSet); } ! private static Method reflectSet = ClassType.make("java.lang.reflect.Array").getDeclaredMethod("set", 3); |
From: <bo...@us...> - 2003-03-05 12:33:59
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1:/tmp/cvs-serv12565/debian Modified Files: changelog Log Message: Closed 0.7.7 Index: changelog =================================================================== RCS file: /cvsroot/nice/Nice/debian/changelog,v retrieving revision 1.134 retrieving revision 1.135 diff -C2 -d -r1.134 -r1.135 *** changelog 26 Feb 2003 16:15:37 -0000 1.134 --- changelog 5 Mar 2003 12:33:54 -0000 1.135 *************** *** 17,25 **** fib(n) = fib(n-2) + fib(n-1); * The '@' in '@null' patterns is deprecated, '@' should be omitted. ! * The 'fun' keyword is deprecated now, you can leave it away. * 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. With the '-- strict' compiler option, use a stricter ! heuristics. Additionally, arrays are always considered to have non-null component types. --- 17,25 ---- 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. *************** *** 33,37 **** * 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. * Faster compilation for large projects with many classes. * Bugfixes (anonymous functions inside functionals with constracts, --- 33,37 ---- * 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, *************** *** 39,43 **** what the parser accepts and the compiler can handle, ...). ! -- nice (0.7.6) unstable; urgency=low --- 39,43 ---- 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 |
From: <bo...@us...> - 2003-03-04 17:09:04
|
Update of /cvsroot/nice/Nice/testsuite/lib/java/util In directory sc8-pr-cvs1:/tmp/cvs-serv2546/testsuite/lib/java/util Modified Files: collections.testsuite Log Message: The sort function is now included in the standard library. Index: collections.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/lib/java/util/collections.testsuite,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** collections.testsuite 3 Mar 2003 16:42:43 -0000 1.5 --- collections.testsuite 4 Mar 2003 17:08:57 -0000 1.6 *************** *** 32,33 **** --- 32,38 ---- s.sort((String s1, String s2) => s2.length - s1.length); assert s[0] == "aaa"; + + List<String> list = [ "C", "BA", "BB", "A" ]; + sort(list, (String s1, String s2) => s1.compareTo(s2)); + assert list[0] == "A"; + assert list[1] == "BA"; |
From: <bo...@us...> - 2003-03-04 17:09:03
|
Update of /cvsroot/nice/Nice/testsuite/lib/nice/lang In directory sc8-pr-cvs1:/tmp/cvs-serv2546/testsuite/lib/nice/lang Modified Files: collections.testsuite Log Message: The sort function is now included in the standard library. Index: collections.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/lib/nice/lang/collections.testsuite,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** collections.testsuite 7 Dec 2002 12:36:33 -0000 1.3 --- collections.testsuite 4 Mar 2003 17:08:56 -0000 1.4 *************** *** 3,26 **** [0,1,2].foreach(int i => `assert`(i == count++)); assert count == 3; - - /// PASS - List<String> list = [ "C", "BA", "BB", "A" ]; - sort(list, (String s1, String s2) => s1.compareTo(s2)); - assert list[0] == "A"; - assert list[1] == "BA"; - - /// Toplevel - interface Comparator<T> = native java.util.Comparator; - - <T> int compare(Comparator<T>,T,T) = - native int Comparator.compare(Object, Object); - - final class NiceComparator<T> implements Comparator - { - (T,T) -> int compare; - - compare(x1, x2) = (this.compare)(x1,x2); - } - - <T> void sort(List<T> list, (T,T) -> int comp) = - Collections.sort(list, new NiceComparator(compare: comp)); --- 3,4 ---- |
From: <bo...@us...> - 2003-03-04 17:07:20
|
Update of /cvsroot/nice/Nice/src/nice/tools/code In directory sc8-pr-cvs1:/tmp/cvs-serv1970/src/nice/tools/code Modified Files: SetFieldProc.java Log Message: Fail faster if an invalid declaration is passed. Index: SetFieldProc.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/code/SetFieldProc.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SetFieldProc.java 2 Feb 2002 12:21:43 -0000 1.6 --- SetFieldProc.java 4 Mar 2003 17:07:14 -0000 1.7 *************** *** 30,33 **** --- 30,35 ---- { this.fieldDecl = fieldDecl; + if (fieldDecl == null) + throw new NullPointerException(); } |
From: <bo...@us...> - 2003-03-04 17:03:30
|
Update of /cvsroot/nice/Nice/testsuite/compiler/statements/loops In directory sc8-pr-cvs1:/tmp/cvs-serv32603/testsuite/compiler/statements/loops Modified Files: break.testsuite Log Message: Fix continue when several unrelated loops are present. Index: break.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/statements/loops/break.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** break.testsuite 25 Jul 2002 13:32:54 -0000 1.1 --- break.testsuite 4 Mar 2003 17:02:53 -0000 1.2 *************** *** 20,21 **** --- 20,36 ---- while (true) break; assert(ok); + + /// PASS + /// COMMENT: do not confuse loops + for (int i = 0; i < 5; i++) + { + for (int i = 0; i < 5; i++) + continue; + if (true) continue; + assert false; + } + + /// PASS + /// COMMENT: do not confuse loops + for (int i = 0; i < 5; i++) continue; + for (int i = 0; i < 5; i++) continue; |
From: <bo...@us...> - 2003-03-04 17:03:07
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv32603/src/bossa/syntax Modified Files: ContinueStmt.java Log Message: Fix continue when several unrelated loops are present. Index: ContinueStmt.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/ContinueStmt.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ContinueStmt.java 28 Jan 2002 20:28:39 -0000 1.1 --- ContinueStmt.java 4 Mar 2003 17:02:55 -0000 1.2 *************** *** 24,31 **** public static ContinueStmt make(LocatedString label) { ! if (label == null) ! return instance; ! else ! return new ContinueStmt(label); } --- 24,28 ---- public static ContinueStmt make(LocatedString label) { ! return new ContinueStmt(label); } |