nice-commit Mailing List for The Nice Programming Language (Page 105)
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: <bo...@us...> - 2003-06-05 09:11:56
|
Update of /cvsroot/nice/Nice/web In directory sc8-pr-cvs1:/tmp/cvs-serv11573 Modified Files: visitor.html safety.xml index.xml Log Message: Typos. Index: visitor.html =================================================================== RCS file: /cvsroot/nice/Nice/web/visitor.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** visitor.html 24 Sep 2001 19:23:31 -0000 1.2 --- visitor.html 5 Jun 2003 09:11:51 -0000 1.3 *************** *** 23,27 **** thorough description is available there</a> from the <i>Design Patterns</i> book. ! <p>A typical exemple is the definition of operations on an Abstract Syntax Tree. Here is Java code using a Visitor: <PRE> --- 23,27 ---- thorough description is available there</a> from the <i>Design Patterns</i> book. ! <p>A typical example is the definition of operations on an Abstract Syntax Tree. Here is Java code using a Visitor: <PRE> *************** *** 94,98 **** in the new package. But then it would be necessary to test the argument with <tt>instanceof</tt> and use downcasts. ! In short, loose the benefits of object-orientation. <br> --- 94,98 ---- in the new package. But then it would be necessary to test the argument with <tt>instanceof</tt> and use downcasts. ! In short, lose the benefits of object-orientation. <br> *************** *** 104,109 **** <li> An obvious problem is that the arguments and the return type of visiting ! methods have to be known in advance. In this exemple, to define a <tt>prettyPrint</tt> ! function that returns a <tt>String</tt>, a new Visitor class has tyo be defined, as well as a new <tt>accept</tt> method <b>in every class of the hierarchy</b>. And the same job has to be done again to define an evaluation --- 104,109 ---- <li> An obvious problem is that the arguments and the return type of visiting ! methods have to be known in advance. In this example, to define a <tt>prettyPrint</tt> ! function that returns a <tt>String</tt>, a new Visitor class has to be defined, as well as a new <tt>accept</tt> method <b>in every class of the hierarchy</b>. And the same job has to be done again to define an evaluation *************** *** 134,138 **** <h2> Alternative solution with Multimethods</h2> ! Here is the same exemple, using multi-methods, in <a href="index.html"><font face="Comic Sans MS">Nice</font></a>. As you can see, it is much --- 134,138 ---- <h2> Alternative solution with Multimethods</h2> ! Here is the same example, using multi-methods, in <a href="index.html"><font face="Comic Sans MS">Nice</font></a>. As you can see, it is much Index: safety.xml =================================================================== RCS file: /cvsroot/nice/Nice/web/safety.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** safety.xml 1 May 2003 13:26:27 -0000 1.3 --- safety.xml 5 Jun 2003 09:11:51 -0000 1.4 *************** *** 455,459 **** In &nice;, arrays are not covariant. Therefore run time errors like <javaexn name="ArrayStoreException"/> never occur. Moreover, it is still ! possible to use covariantly arrays while only reading from them. This require &nice;'s powerful type system: constrained type parameters: <literal><java.awt.Component T> void read(T[]);</literal> --- 455,459 ---- In &nice;, arrays are not covariant. Therefore run time errors like <javaexn name="ArrayStoreException"/> never occur. Moreover, it is still ! possible to use arrays covariantly while only reading from them. This require &nice;'s powerful type system: constrained type parameters: <literal><java.awt.Component T> void read(T[]);</literal> Index: index.xml =================================================================== RCS file: /cvsroot/nice/Nice/web/index.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** index.xml 18 Apr 2003 17:19:54 -0000 1.5 --- index.xml 5 Jun 2003 09:11:51 -0000 1.6 *************** *** 132,136 **** The current implementation is tightly integrated with the Java environment, which offers several advantages. ! The huge amnount of Java libraries can be used directly in Nice programs. Libraries can also be written in Nice and called from a Java program. The Nice compiler produces java bytecode, which means --- 132,136 ---- The current implementation is tightly integrated with the Java environment, which offers several advantages. ! The huge amount of Java libraries can be used directly in Nice programs. Libraries can also be written in Nice and called from a Java program. The Nice compiler produces java bytecode, which means |
From: <ar...@us...> - 2003-06-04 22:53:07
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1:/tmp/cvs-serv16050/F:/nice/src/bossa/parser Modified Files: Parser.jj Log Message: Boolean patterns use ConstantExp now. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.178 retrieving revision 1.179 diff -C2 -d -r1.178 -r1.179 *** Parser.jj 4 Jun 2003 21:37:45 -0000 1.178 --- Parser.jj 4 Jun 2003 22:53:03 -0000 1.179 *************** *** 2224,2227 **** --- 2224,2228 ---- | res=intConstantExp() | res=charConstantExp() + | res=booleanConstantExp() ) { return res; } |
From: <ar...@us...> - 2003-06-04 22:53:06
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv16050/F:/nice/src/bossa/syntax Modified Files: Pattern.java Log Message: Boolean patterns use ConstantExp now. Index: Pattern.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Pattern.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** Pattern.java 1 Jun 2003 10:45:24 -0000 1.48 --- Pattern.java 4 Jun 2003 22:53:02 -0000 1.49 *************** *** 63,89 **** this.location = location; ! if(tc == null && atValue == null && name != null) ! { ! String ident = name.toString(); ! if (ident.equals("true") || ident.equals("false")) ! { ! this.atValue = new IdentExp(name); ! this.name = null; ! this.typeConstructor = ! new TypeIdent(new LocatedString("boolean",location)); ! } ! } ! else if (tc != null) { ! String ident = tc.getName().toString(); ! if (ident.equals("true") || ident.equals("false")) ! { ! this.atValue = new IdentExp(tc.getName()); ! this.typeConstructor = ! new TypeIdent(new LocatedString("boolean",location)); ! } } ! ! if (atValue != null && atValue instanceof ConstantExp) { this.atIntValue = true; --- 63,72 ---- this.location = location; ! if (atValue != null && atValue instanceof ConstantExp && ! ((ConstantExp)atValue).value instanceof Boolean ) { ! this.tc = PrimitiveType.boolTC; } ! else if (atValue != null && atValue instanceof ConstantExp) { this.atIntValue = true; *************** *** 501,505 **** else if (name.equals("true") || name.equals("false") ) { ! atValue = new IdentExp(new LocatedString(name, Location.nowhere())); tc = PrimitiveType.boolTC; } --- 484,488 ---- else if (name.equals("true") || name.equals("false") ) { ! atValue = ConstantExp.makeBoolean(name.equals("true"), Location.nowhere()); tc = PrimitiveType.boolTC; } *************** *** 589,596 **** } public boolean atTrue() { ! return atBool() && atValue.toString().equals("true"); } public boolean atFalse() { ! return atBool() && atValue.toString().equals("false"); } --- 572,579 ---- } public boolean atTrue() { ! return atBool() && ((ConstantExp)atValue).isTrue(); } public boolean atFalse() { ! return atBool() && ((ConstantExp)atValue).isFalse(); } |
From: <bo...@us...> - 2003-06-04 21:38:20
|
Update of /cvsroot/nice/Nice/testsuite/compiler/statements/flow In directory sc8-pr-cvs1:/tmp/cvs-serv7832/testsuite/compiler/statements/flow Modified Files: reachability.testsuite Log Message: '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. Note to Nice hackers: you need the latest development version to bootstrap the compiler because of this change. Index: reachability.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/statements/flow/reachability.testsuite,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** reachability.testsuite 9 May 2003 13:17:02 -0000 1.2 --- reachability.testsuite 4 Jun 2003 21:37:42 -0000 1.3 *************** *** 1,8 **** ! /// FAIL bug while (false) { /*/// FAIL HERE */ ; // Unreachable } ! /// FAIL bug while (true) ; /*/// FAIL HERE */ ; // Unreachable --- 1,8 ---- ! /// FAIL while (false) { /*/// FAIL HERE */ ; // Unreachable } ! /// FAIL while (true) ; /*/// FAIL HERE */ ; // Unreachable *************** *** 12,16 **** ; // Reachable ! /// FAIL bug for (;false;) { /*/// FAIL HERE */ ; // Unreachable --- 12,16 ---- ; // Reachable ! /// FAIL for (;false;) { /*/// FAIL HERE */ ; // Unreachable |
From: <bo...@us...> - 2003-06-04 21:38:20
|
Update of /cvsroot/nice/Nice/src/gnu/bytecode In directory sc8-pr-cvs1:/tmp/cvs-serv7832/src/gnu/bytecode Modified Files: Field.java Log Message: '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. Note to Nice hackers: you need the latest development version to bootstrap the compiler because of this change. Index: Field.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/bytecode/Field.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Field.java 24 Jan 2003 12:23:09 -0000 1.3 --- Field.java 4 Jun 2003 21:37:43 -0000 1.4 *************** *** 133,138 **** switch (sig1) { - case 'C': case 'Z': case 'B': case 'S': --- 133,139 ---- switch (sig1) { case 'Z': + entry = cpool.addInt(((Boolean) value).booleanValue() ? 1 : 0); break; + case 'C': case 'B': case 'S': |
From: <bo...@us...> - 2003-06-04 21:38:19
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1:/tmp/cvs-serv7832/stdlib/nice/lang Modified Files: booleans.nice Log Message: '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. Note to Nice hackers: you need the latest development version to bootstrap the compiler because of this change. Index: booleans.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/booleans.nice,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** booleans.nice 1 Apr 2003 20:51:40 -0000 1.9 --- booleans.nice 4 Jun 2003 21:37:43 -0000 1.10 *************** *** 13,21 **** boolean `!=`(boolean, boolean) = inline nice.lang.inline.BoolOp("^"); - boolean TRUE() = native Boolean.TRUE; - boolean FALSE() = native Boolean.FALSE; - var boolean true = TRUE(); - var boolean false = FALSE(); - /** Booleans form a boolean algebra. --- 13,16 ---- |
From: <bo...@us...> - 2003-06-04 21:37:51
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1:/tmp/cvs-serv7832/debian Modified Files: changelog Log Message: '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. Note to Nice hackers: you need the latest development version to bootstrap the compiler because of this change. Index: changelog =================================================================== RCS file: /cvsroot/nice/Nice/debian/changelog,v retrieving revision 1.169 retrieving revision 1.170 diff -C2 -d -r1.169 -r1.170 *** changelog 3 Jun 2003 19:43:58 -0000 1.169 --- changelog 4 Jun 2003 21:37:45 -0000 1.170 *************** *** 5,8 **** --- 5,11 ---- Nice libraries. * 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. -- |
From: <bo...@us...> - 2003-06-04 21:37:51
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1:/tmp/cvs-serv7832/src/bossa/parser Modified Files: Parser.jj Log Message: '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. Note to Nice hackers: you need the latest development version to bootstrap the compiler because of this change. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.177 retrieving revision 1.178 diff -C2 -d -r1.177 -r1.178 *** Parser.jj 3 Jun 2003 12:21:57 -0000 1.177 --- Parser.jj 4 Jun 2003 21:37:45 -0000 1.178 *************** *** 48,58 **** return symb(t.image,t); } - /* - private static final Expression trueExp = - new IdentExp(new LocatedString("true", Location.nowhere())); - - private static final Expression falseExp = - new IdentExp(new LocatedString("false", Location.nowhere())); - */ static List globalDefinitions; } --- 48,51 ---- *************** *** 175,180 **** | < WHILE: "while" > | < DO: "do" > ! //| < TRUE: "true" > ! //| < FALSE: "false" > | < FUN: "fun" > /* Nice specific */ | < ALIKE: "alike" > /* Nice specific */ --- 168,173 ---- | < WHILE: "while" > | < DO: "do" > ! | < TRUE: "true" > ! | < FALSE: "false" > | < FUN: "fun" > /* Nice specific */ | < ALIKE: "alike" > /* Nice specific */ *************** *** 1534,1537 **** --- 1527,1539 ---- /***********************************************************************/ + Expression booleanConstantExp(): + { + Token t; + } + { + t = "true" { return ConstantExp.makeBoolean(true, new Location(t)); } + | t = "false" { return ConstantExp.makeBoolean(false, new Location(t)); } + } + Expression intConstantExp(): { *************** *** 2198,2201 **** --- 2200,2204 ---- ( "null" { res = NullExp.instance; } + | res=booleanConstantExp() | res=intConstantExp() | res=floatConstantExp() |
From: <bo...@us...> - 2003-06-04 21:37:50
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv7832/src/bossa/syntax Modified Files: ConstantExp.java Log Message: '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. Note to Nice hackers: you need the latest development version to bootstrap the compiler because of this change. Index: ConstantExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/ConstantExp.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** ConstantExp.java 9 May 2003 11:57:38 -0000 1.39 --- ConstantExp.java 4 Jun 2003 21:37:43 -0000 1.40 *************** *** 251,253 **** --- 251,277 ---- return new TypeConstantExp(representation); } + + /**************************************************************** + * Booleans + ****************************************************************/ + + public static ConstantExp makeBoolean(boolean value, Location location) + { + if (value) + return new ConstantExp(PrimitiveType.boolTC, Boolean.TRUE, + "true", location); + else + return new ConstantExp(PrimitiveType.boolTC, Boolean.FALSE, + "false", location); + } + + boolean isFalse() + { + return value == Boolean.FALSE; + } + + boolean isTrue() + { + return value == Boolean.TRUE; + } } |
From: <bo...@us...> - 2003-06-04 21:37:48
|
Update of /cvsroot/nice/Nice/testsuite/compiler/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv7832/testsuite/compiler/syntax Added Files: keywords.testsuite Log Message: '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. Note to Nice hackers: you need the latest development version to bootstrap the compiler because of this change. --- NEW FILE: keywords.testsuite --- /// FAIL let /* /// FAIL HERE */ true = false; // If the above was allowed, life would be different: while (true) {} println("Eternity is over now!"); |
From: <ar...@us...> - 2003-06-04 18:46:34
|
Update of /cvsroot/nice/Nice/testsuite/compiler/expressions/tuples In directory sc8-pr-cvs1:/tmp/cvs-serv6646/F:/nice/testsuite/compiler/expressions/tuples Modified Files: compilation.testsuite Log Message: Testcase for bug #749019. Index: compilation.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/expressions/tuples/compilation.testsuite,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** compilation.testsuite 17 Mar 2003 20:11:40 -0000 1.6 --- compilation.testsuite 4 Jun 2003 18:46:30 -0000 1.7 *************** *** 44,45 **** --- 44,50 ---- (long i, long j) = longs; i += j; + + /// PASS bug + (String fst, String snd) = foo("abc","xyz"); + /// Toplevel + <T,U> (T,U) foo(T x, U y) = (x,y); |
From: <bo...@us...> - 2003-06-04 17:06:56
|
Update of /cvsroot/nice/Nice/regtest/coreJava In directory sc8-pr-cvs1:/tmp/cvs-serv20954/regtest/coreJava Modified Files: coreJava.nice.template coreJava.java.template coreJava.code Log Message: Fixed the type of `>=` for longs. Index: coreJava.nice.template =================================================================== RCS file: /cvsroot/nice/Nice/regtest/coreJava/coreJava.nice.template,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** coreJava.nice.template 7 Sep 2002 19:07:08 -0000 1.6 --- coreJava.nice.template 4 Jun 2003 17:06:54 -0000 1.7 *************** *** 6,12 **** package regtest.coreJava; ! void p(String); ! p(s) = println(s); class A --- 6,12 ---- package regtest.coreJava; ! void p(String s) = println(s); + void p(boolean b) = println("" + b); class A Index: coreJava.java.template =================================================================== RCS file: /cvsroot/nice/Nice/regtest/coreJava/coreJava.java.template,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** coreJava.java.template 1 May 2002 21:13:26 -0000 1.5 --- coreJava.java.template 4 Jun 2003 17:06:54 -0000 1.6 *************** *** 23,26 **** --- 23,31 ---- } + public static void p(boolean b) + { + System.out.println("" + b); + } + static A createA(int x, long y) { Index: coreJava.code =================================================================== RCS file: /cvsroot/nice/Nice/regtest/coreJava/coreJava.code,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** coreJava.code 21 Aug 2002 17:16:34 -0000 1.24 --- coreJava.code 4 Jun 2003 17:06:54 -0000 1.25 *************** *** 93,97 **** --- 93,130 ---- p("" + (i+(j-y)*x)); + } + + { + // Numeric comparison + + int i = 1; + long l = 2; + float f = 2.5f; + double d = 2.7; + + p(i < i); + p(i < l); + p(i < f); + p(i < d); + + p(i <= i); + p(i <= l); + p(i <= f); + p(i <= d); + + p(i > i); + p(i > l); + p(i > f); + p(i > d); + + p(i >= i); + p(i >= l); + p(i >= f); + p(i >= d); + + } + + // booleans |
From: <bo...@us...> - 2003-06-04 17:06:56
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1:/tmp/cvs-serv20954/stdlib/nice/lang Modified Files: numeric.nice Log Message: Fixed the type of `>=` for longs. Index: numeric.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/numeric.nice,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** numeric.nice 3 Jun 2003 19:43:57 -0000 1.26 --- numeric.nice 4 Jun 2003 17:06:53 -0000 1.27 *************** *** 53,57 **** boolean `>=`(double, double) = inline nice.lang.inline.CompOp("dGe"); boolean `>=`(float, float) = inline nice.lang.inline.CompOp("fGe"); ! boolean `>=`(float, float) = inline nice.lang.inline.CompOp("lGe"); boolean `>=`(int, int) = inline nice.lang.inline.CompOp("iGe"); --- 53,57 ---- boolean `>=`(double, double) = inline nice.lang.inline.CompOp("dGe"); boolean `>=`(float, float) = inline nice.lang.inline.CompOp("fGe"); ! boolean `>=`(long, long) = inline nice.lang.inline.CompOp("lGe"); boolean `>=`(int, int) = inline nice.lang.inline.CompOp("iGe"); |
From: <bo...@us...> - 2003-06-04 17:06:56
|
Update of /cvsroot/nice/Nice/testsuite/compiler/overloading In directory sc8-pr-cvs1:/tmp/cvs-serv20954/testsuite/compiler/overloading Modified Files: resolution.testsuite Log Message: Fixed the type of `>=` for longs. Index: resolution.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/overloading/resolution.testsuite,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** resolution.testsuite 4 Jun 2003 00:11:43 -0000 1.2 --- resolution.testsuite 4 Jun 2003 17:06:53 -0000 1.3 *************** *** 59,67 **** int foo() = 42; ! /// PASS bug /// Toplevel void foo(long e) requires e >= 0 {} ! /// PASS bug /// Toplevel void foo(float e) requires e >= 0 {} --- 59,67 ---- int foo() = 42; ! /// PASS /// Toplevel void foo(long e) requires e >= 0 {} ! /// PASS /// Toplevel void foo(float e) requires e >= 0 {} |
From: <ar...@us...> - 2003-06-04 00:11:48
|
Update of /cvsroot/nice/Nice/testsuite/compiler/overloading In directory sc8-pr-cvs1:/tmp/cvs-serv24795/F:/nice/testsuite/compiler/overloading Modified Files: resolution.testsuite Log Message: Added some testcase for a strang bug in resolving overloading inside contracts. Index: resolution.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/overloading/resolution.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** resolution.testsuite 24 Apr 2003 12:29:41 -0000 1.1 --- resolution.testsuite 4 Jun 2003 00:11:43 -0000 1.2 *************** *** 58,59 **** --- 58,75 ---- } int foo() = 42; + + /// PASS bug + /// Toplevel + void foo(long e) requires e >= 0 {} + + /// PASS bug + /// Toplevel + void foo(float e) requires e >= 0 {} + + /// PASS + /// Toplevel + void foo(double e) requires e >= 0 {} + + /// PASS + /// Toplevel + void foo(int e) requires e >= 0 {} |
From: <ar...@us...> - 2003-06-03 20:41:31
|
Update of /cvsroot/nice/Nice/testsuite/lib/nice/lang In directory sc8-pr-cvs1:/tmp/cvs-serv20956/F:/nice/testsuite/lib/nice/lang Modified Files: numeric.testsuite Log Message: Merge some testcases. Index: numeric.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/lib/nice/lang/numeric.testsuite,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** numeric.testsuite 3 Jun 2003 19:43:57 -0000 1.4 --- numeric.testsuite 3 Jun 2003 20:41:27 -0000 1.5 *************** *** 103,119 **** /// PASS assert 7**0 == 1; - - /// PASS assert -5**1 == -5; - - /// PASS assert -4**6 == 4096; - - /// PASS assert 3**9 == 19683; - - /// PASS assert -7**5 == -16807; - - /// PASS assert 5**3**2 == 1953125; --- 103,109 ---- |
From: <xo...@us...> - 2003-06-03 20:09:04
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1:/tmp/cvs-serv2386 Modified Files: Makefile Log Message: Added two new make targets, check_compiler and check_lib, so you can run just the compiler test suites or just the stdlib testsuites. The check target is now defined as check: check_compiler check_lib. Index: Makefile =================================================================== RCS file: /cvsroot/nice/Nice/Makefile,v retrieving revision 1.117 retrieving revision 1.118 diff -C2 -d -r1.117 -r1.118 *** Makefile 26 Apr 2003 23:51:52 -0000 1.117 --- Makefile 3 Jun 2003 20:09:01 -0000 1.118 *************** *** 76,84 **** cd regtest; JAVA="${java}" /usr/bin/time ./regtest ! check: if [ `${java} -h 2>&1 | grep -- -enableassertions | wc -l` = 0 ]; then\ ! /usr/bin/time ${java} -Dassertions=true -classpath "classes" nice.tools.testsuite.TestNice testsuite; \ else \ ! /usr/bin/time ${java} -enableassertions -classpath "classes" nice.tools.testsuite.TestNice testsuite; \ fi --- 76,93 ---- cd regtest; JAVA="${java}" /usr/bin/time ./regtest ! check: check_compiler check_lib ! ! check_compiler: if [ `${java} -h 2>&1 | grep -- -enableassertions | wc -l` = 0 ]; then\ ! /usr/bin/time ${java} -Dassertions=true -classpath "classes" nice.tools.testsuite.TestNice testsuite/compiler; \ else \ ! /usr/bin/time ${java} -enableassertions -classpath "classes" nice.tools.testsuite.TestNice testsuite/compiler; \ ! fi ! ! check_lib: ! if [ `${java} -h 2>&1 | grep -- -enableassertions | wc -l` = 0 ]; then\ ! /usr/bin/time ${java} -Dassertions=true -classpath "classes" nice.tools.testsuite.TestNice testsuite/lib; \ ! else \ ! /usr/bin/time ${java} -enableassertions -classpath "classes" nice.tools.testsuite.TestNice testsuite/lib; \ fi |
From: <ar...@us...> - 2003-06-03 19:44:01
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1:/tmp/cvs-serv20386/F:/nice/debian Modified Files: changelog Log Message: Implemented the '**' operator for longs, doubles and BigIntegers. Index: changelog =================================================================== RCS file: /cvsroot/nice/Nice/debian/changelog,v retrieving revision 1.168 retrieving revision 1.169 diff -C2 -d -r1.168 -r1.169 *** changelog 2 Jun 2003 17:43:14 -0000 1.168 --- changelog 3 Jun 2003 19:43:58 -0000 1.169 *************** *** 1,4 **** --- 1,5 ---- nice (0.9.0) unstable; urgency=low + * Added operator ** to calculate powers of longs, doubles and BigIntegers. * Archives (generated with the -a option) can now be used to distribute Nice libraries. |
From: <ar...@us...> - 2003-06-03 19:44:01
|
Update of /cvsroot/nice/Nice/testsuite/lib/nice/lang In directory sc8-pr-cvs1:/tmp/cvs-serv20386/F:/nice/testsuite/lib/nice/lang Modified Files: numeric.testsuite Log Message: Implemented the '**' operator for longs, doubles and BigIntegers. Index: numeric.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/lib/nice/lang/numeric.testsuite,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** numeric.testsuite 1 May 2003 22:42:17 -0000 1.3 --- numeric.testsuite 3 Jun 2003 19:43:57 -0000 1.4 *************** *** 100,101 **** --- 100,119 ---- /// Toplevel var int x = 0; + + /// PASS + assert 7**0 == 1; + + /// PASS + assert -5**1 == -5; + + /// PASS + assert -4**6 == 4096; + + /// PASS + assert 3**9 == 19683; + + /// PASS + assert -7**5 == -16807; + + /// PASS + assert 5**3**2 == 1953125; |
From: <ar...@us...> - 2003-06-03 19:44:01
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1:/tmp/cvs-serv20386/F:/nice/stdlib/nice/lang Modified Files: bigint.nice numeric.nice Log Message: Implemented the '**' operator for longs, doubles and BigIntegers. Index: bigint.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/bigint.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** bigint.nice 20 May 2003 15:06:01 -0000 1.1 --- bigint.nice 3 Jun 2003 19:43:57 -0000 1.2 *************** *** 13,16 **** --- 13,18 ---- BigInteger `%`(BigInteger, BigInteger) = native BigInteger BigInteger.remainder(BigInteger); + BigInteger `**`(BigInteger, int) = native BigInteger BigInteger.pow(int); + BigInteger `<<`(BigInteger, int) = native BigInteger BigInteger.shiftLeft(int); BigInteger `>>`(BigInteger, int) = native BigInteger BigInteger.shiftRight(int); Index: numeric.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/numeric.nice,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** numeric.nice 30 Apr 2003 21:03:23 -0000 1.25 --- numeric.nice 3 Jun 2003 19:43:57 -0000 1.26 *************** *** 213,214 **** --- 213,233 ---- // Comparable interface `<`(n1@Number, n2@Number) = n1.doubleValue() < n2.doubleValue(); + + // exponential functions + long `**`(long x, long e) { + if (e < 0) throw new IllegalArgumentException(); + if (e == 0) return 1; + + long res = 1; + long tmp = x; + do { + if ( (e & 1L) != 0) res *= tmp; + + tmp *= tmp; + e = e >> 1; + } while (e != 0); + + return res; + } + + double `**`(double, double) = native double Math.pow(double, double); |
From: <xo...@us...> - 2003-06-03 19:18:05
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1:/tmp/cvs-serv4224/stdlib/nice/lang Modified Files: strings.nice Log Message: Added doc comments for split and join, and added a requires clause to split Index: strings.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/strings.nice,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** strings.nice 2 Jun 2003 22:11:53 -0000 1.9 --- strings.nice 3 Jun 2003 19:14:18 -0000 1.10 *************** *** 50,55 **** char charAt(String s, int index) = native char String.charAt(int); ! ! List<String> split(String str, String sep) { List<String> res = new ArrayList(); --- 50,63 ---- char charAt(String s, int index) = native char String.charAt(int); ! /** ! * Break a string into a <code>List<String></code> of substrings, ! * splitting at (and removing) every occurrence of the <code>separator</code> ! * string. ! * ! * @param str the string to split ! * @param separator the separator to split on ! */ ! List<String> split(String str, String separator) ! requires separator.length() > 0 : "separator cannot be the empty string" { List<String> res = new ArrayList(); *************** *** 58,62 **** while(ntx > -1) { ! ntx = str.indexOf(sep, pos); if (ntx > -1) { --- 66,70 ---- while(ntx > -1) { ! ntx = str.indexOf(separator, pos); if (ntx > -1) { *************** *** 65,69 **** res.add(str.substring(pos, ntx)); } ! pos = ntx + sep.length; } else --- 73,77 ---- res.add(str.substring(pos, ntx)); } ! pos = ntx + separator.length; } else *************** *** 75,79 **** } ! String join(List<String> strings, String sep) { StringBuffer buff = new StringBuffer(); --- 83,95 ---- } ! /** ! * Join a collection of strings together, interspersing <code>separator</code> ! * among them. ! * ! * @param strings the strings to join ! * @param separator the separator string to place between each ! * string and the one before it ! */ ! String join(Collection<String> strings, String separator) { StringBuffer buff = new StringBuffer(); *************** *** 83,87 **** buff.append(it.next()); if (it.hasNext()) ! buff.append(sep); } return buff.toString(); --- 99,103 ---- buff.append(it.next()); if (it.hasNext()) ! buff.append(separator); } return buff.toString(); |
From: <xo...@us...> - 2003-06-03 19:12:54
|
Update of /cvsroot/nice/Nice/testsuite/lib/nice/lang In directory sc8-pr-cvs1:/tmp/cvs-serv3282/testsuite/lib/nice/lang Modified Files: strings.testsuite Log Message: Consolidated test cases Index: strings.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/lib/nice/lang/strings.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** strings.testsuite 2 Jun 2003 22:11:54 -0000 1.1 --- strings.testsuite 3 Jun 2003 19:12:52 -0000 1.2 *************** *** 2,16 **** List<String> splits = split("foo,bar,baz", ","); assert splits.size == 3; - - /// PASS - List<String> splits = split("foo,bar,baz", ","); assert splits[0].equals("foo"); - - /// PASS - List<String> splits = split("foo,bar,baz", ","); assert splits[1].equals("bar"); - - /// PASS - List<String> splits = split("foo,bar,baz", ","); assert splits[2].equals("baz"); --- 2,7 ---- *************** *** 18,28 **** List<String> splits = split("foo,bar,foo,baz", "foo,"); assert splits.size == 2; - - /// PASS - List<String> splits = split("foo,bar,foo,baz", "foo,"); assert splits[0].equals("bar,"); - - /// PASS - List<String> splits = split("foo,bar,foo,baz", "foo,"); assert splits[1].equals("baz"); --- 9,13 ---- |
From: <ar...@us...> - 2003-06-03 13:24:09
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing In directory sc8-pr-cvs1:/tmp/cvs-serv7177/F:/nice/testsuite/compiler/typing Modified Files: typeParameters.testsuite Log Message: Testcases for 2 known bugs. Index: typeParameters.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/typing/typeParameters.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** typeParameters.testsuite 10 Sep 2002 16:58:33 -0000 1.1 --- typeParameters.testsuite 3 Jun 2003 13:24:05 -0000 1.2 *************** *** 3,4 **** --- 3,10 ---- class A<T> {} void f(/* /// FAIL HERE */ A) {} + + /// FAIL bug + /// Toplevel + class X<T> {} + <T | T <: X<T> > void f() {} + // should fail without causing a stack overflow. |
From: <ar...@us...> - 2003-06-03 13:24:08
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods In directory sc8-pr-cvs1:/tmp/cvs-serv7177/F:/nice/testsuite/compiler/methods Modified Files: constrained.testsuite Log Message: Testcases for 2 known bugs. Index: constrained.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/methods/constrained.testsuite,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** constrained.testsuite 29 Apr 2003 16:00:55 -0000 1.2 --- constrained.testsuite 3 Jun 2003 13:24:04 -0000 1.3 *************** *** 63,64 **** --- 63,75 ---- foo(@Y,@Y) {} foo(@X,@Y) {} + + /// FAIL bug + ///Toplevel + class A{} + class B extends A{} + interface I<+T | B <: T>{} + class X<+T | A <: T> implements I<T>{} + + void foo(I<B>); + foo(@X){} + //@X is not in the domain of foo |
From: <ar...@us...> - 2003-06-03 12:22:01
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1:/tmp/cvs-serv22627/F:/nice/src/bossa/parser Modified Files: Parser.jj Log Message: Parser support for operators '..' and '**'. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.176 retrieving revision 1.177 diff -C2 -d -r1.176 -r1.177 *** Parser.jj 2 Jun 2003 17:43:13 -0000 1.176 --- Parser.jj 3 Jun 2003 12:21:57 -0000 1.177 *************** *** 126,130 **** | < PLUS: "+" > | < MINUS: "-" > ! // | < POWER: "**" > | < MULT: "*" > | < SLASH: "/" > --- 126,131 ---- | < PLUS: "+" > | < MINUS: "-" > ! | < RANGE: ".." > ! | < POWER: "**" > | < MULT: "*" > | < SLASH: "/" > *************** *** 1270,1274 **** { Expression exp; } "=" ! ( "." "." "." { return null; } // toplevel function in interface file | exp=Expression() ";" --- 1271,1275 ---- { Expression exp; } "=" ! ( ".." "." { return null; } // toplevel function in interface file | exp=Expression() ";" *************** *** 1930,1936 **** { Expression e1, e2, e3; Token t; e3 = null; } { ! e1=ShiftExpression() [ ( ! ( (t=">"|t=">=") e2=ShiftExpression() { if(e3 == null) e1=CallExp.create(symb(t),e1,e2); --- 1931,1937 ---- { Expression e1, e2, e3; Token t; e3 = null; } { ! e1=RangeExpression() [ ( ! ( (t=">"|t=">=") e2=RangeExpression() { if(e3 == null) e1=CallExp.create(symb(t),e1,e2); *************** *** 1940,1944 **** )+ | ! ( (t="<"|t="<=") e2=ShiftExpression() { if(e3 == null) e1=CallExp.create(symb(t),e1,e2); --- 1941,1945 ---- )+ | ! ( (t="<"|t="<=") e2=RangeExpression() { if(e3 == null) e1=CallExp.create(symb(t),e1,e2); *************** *** 1952,1955 **** --- 1953,1967 ---- } + Expression RangeExpression() : + { Expression e1,e2; Token t; } + { + e1=ShiftExpression() + ( t=".." e2=ShiftExpression() + { e1=CallExp.create(symb(t),e1,e2); } + )* + { return e1; } + } + + Expression ShiftExpression() : { Expression e1,e2; Token t,t1=null; boolean left=false; } *************** *** 1985,1992 **** { Expression e1,e2; Token t; } { ! e1=UnaryExpression() ! ( (t="*"|t="/"|t="%") e2=UnaryExpression() { e1=CallExp.create(symb(t),e1,e2); } )* { return e1; } } --- 1997,2016 ---- { Expression e1,e2; Token t; } { ! e1=ExponentialExpression() ! ( (t="*"|t="/"|t="%") e2=ExponentialExpression() { e1=CallExp.create(symb(t),e1,e2); } )* + { return e1; } + } + + + Expression ExponentialExpression() : + { Expression e1,e2; Token t; } + { + e1=UnaryExpression() + // '**' has right associativity + [ t="**" e2=ExponentialExpression() + { e1=CallExp.create(symb(t),e1,e2); } + ] { return e1; } } |