nice-commit Mailing List for The Nice Programming Language (Page 48)
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-06-09 09:49:14
|
Update of /cvsroot/nice/swing/src/nice/ui/common/types/awt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5968/src/nice/ui/common/types/awt Modified Files: java.nice Log Message: Layout managers can be set to null. Index: java.nice =================================================================== RCS file: /cvsroot/nice/swing/src/nice/ui/common/types/awt/java.nice,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** java.nice 27 Feb 2004 18:32:08 -0000 1.7 --- java.nice 9 Jun 2004 09:49:03 -0000 1.8 *************** *** 769,773 **** void processContainerEvent(java.awt.Container, ContainerEvent) = native void java.awt.Container.processContainerEvent(ContainerEvent); ! void setLayout(java.awt.Container, LayoutManager) = native void java.awt.Container.setLayout(LayoutManager); --- 769,773 ---- void processContainerEvent(java.awt.Container, ContainerEvent) = native void java.awt.Container.processContainerEvent(ContainerEvent); ! void setLayout(java.awt.Container, ?LayoutManager) = native void java.awt.Container.setLayout(LayoutManager); |
From: Francis B. <fb...@us...> - 2004-06-02 00:19:43
|
Update of /cvsroot/nice/Nice/src/nice/tools/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25862/src/nice/tools/doc Modified Files: comment.nice Log Message: There is now a mechanism for parsing and sorting comments, in particular '@' comments. It uses a binary tree structure for sorting. This is a backup check-in - the code compiles but is not thoroughly tested. Index: comment.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/doc/comment.nice,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** comment.nice 27 Apr 2004 12:56:52 -0000 1.2 --- comment.nice 2 Jun 2004 00:19:32 -0000 1.3 *************** *** 19,27 **** * The constructor of this class should be used put a comment block in * <i>commentStr</i> (the default value is the empty string. */ class Comment { //a list of tuples that maps tags, such as @param, to values //this value is initialised by the custom constructor ! ArrayList<(?String,String)> tags = cast(null); String commentStr = ""; --- 19,28 ---- * The constructor of this class should be used put a comment block in * <i>commentStr</i> (the default value is the empty string. + * @author Francis Barber */ class Comment { //a list of tuples that maps tags, such as @param, to values //this value is initialised by the custom constructor ! List<(?String,String)> tags = cast(null); String commentStr = ""; *************** *** 39,45 **** * @return a list of tuples mapping tags to values. */ ! ArrayList<(?String,String)> parse(String comments) { //an initial capacity of 8 is used becuase I don't expect many values ! ArrayList<(?String,String)> list = new ArrayList(8); StringBuffer buf = new StringBuffer(comments); //the first and last chars should be '/' --- 40,47 ---- * @return a list of tuples mapping tags to values. */ ! List<(?String,String)> parse(String comments) { //an initial capacity of 8 is used becuase I don't expect many values ! //ArrayList<(?String,String)> list = new ArrayList(8); ! StringBuffer buf = new StringBuffer(comments); //the first and last chars should be '/' *************** *** 48,52 **** buf.deleteCharAt(buf.length()-1); } ! //else do something for(int i = 0; i < buf.length; /*no increment*/) { if(buf.charAt(i) == '*' && (i == 0 || buf.charAt(i-1) == '\n')) { --- 50,54 ---- buf.deleteCharAt(buf.length()-1); } ! //else this is a problem - do something for(int i = 0; i < buf.length; /*no increment*/) { if(buf.charAt(i) == '*' && (i == 0 || buf.charAt(i-1) == '\n')) { *************** *** 64,67 **** --- 66,70 ---- StringTokenizer st = new StringTokenizer(buf.toString(), "@", true /*return delimiters*/); boolean isParam = false; + ?Node root = null; for(int i = 0; st.hasMoreTokens(); i++) { //println("\"Token " i ": " st.nextToken().trim() "\""); *************** *** 76,87 **** */ int index = token.indexOf(' '); ! list.add(("@" token.substring(0, index), token.substring(index+1))); isParam = false; } else { //this is a general comment ! list.add((null, token)); } } ! return list; } \ No newline at end of file --- 79,151 ---- */ int index = token.indexOf(' '); ! //list.add(("@" token.substring(0, index), token.substring(index+1))); ! if(root == null) ! root = new Node(value: ("@" token.substring(0, index), token.substring(index+1))); ! else ! root.insert(new Node(value: ("@" token.substring(0, index), token.substring(index+1)))); isParam = false; } else { //this is a general comment ! //list.add((null, token)); ! if(root == null) ! root = new Node(value: (null, token)); ! else ! root.insert(new Node(value: (null, token))); } } ! return toList(root); ! } ! ! class Node { ! (?String,String) value; ! ?Node left = null; ! ?Node right = null; ! } ! ! List<(?String,String)> toList(?Node root) { ! if(root != null) { ! //get the result of the left branch ! List<(?String,String)> l = toList(root.left); ! //add ourselves ! l.add(root.value); ! //add the right branch ! l.addAll(toList(root.right)); ! return l; ! } ! else { ! return new LinkedList(); ! } ! } ! ! void insert(Node root, Node node) { ! if(compare(node.value, root.value) < 0) { ! //node is less than current ! if(root.left != null) ! insert(notNull(root.left), node); ! else ! root.left = node; ! } else { ! //node is greater than or equal to current ! if(root.right != null) ! insert(notNull(root.right), node); ! else ! root.right = node; ! } ! } ! ! /*This method needs to actually sort in a sensible order.*/ ! int compare((?String,String) t1, (?String,String) t2) { ! (?String s1, String r1) = t1; ! (?String s2, String r2) = t2; ! if(s1 == null) { ! if(s2 == null) ! return 0; ! else ! return 1; ! } ! else if(s2 == null) ! return -1; ! else ! return s1.compareTo(s2); } \ No newline at end of file |
From: Bryn K. <xo...@us...> - 2004-05-28 21:29:30
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18018/testsuite/compiler/typing Modified Files: instanceof.testsuite Log Message: Test for instanceof with type variables. Index: instanceof.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/typing/instanceof.testsuite,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** instanceof.testsuite 30 Nov 2003 14:24:35 -0000 1.19 --- instanceof.testsuite 28 May 2004 21:29:20 -0000 1.20 *************** *** 320,321 **** --- 320,331 ---- assert x.life == 42; }); + + /// PASS bug + <T,U | U <: T> U narrow(T obj) + { + if (obj instanceof U) + return obj; + else + throw new ClassCastException(obj.getClass().getName()); + } + |
From: Bryn K. <xo...@us...> - 2004-05-26 22:12:57
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5957/stdlib/nice/lang Modified Files: collections.nice Log Message: Added variant of List.sort that works with Comparable elements only, using the Comparable comparison functions. Index: collections.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/collections.nice,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** collections.nice 24 May 2004 18:47:02 -0000 1.66 --- collections.nice 26 May 2004 22:12:46 -0000 1.67 *************** *** 180,183 **** --- 180,191 ---- } + /** + * Uses the default comparison methods defined in Comparable to sort + * the list. + */ + <Comparable T> void sort(List<T> list) { + sort(list, (T t1,T t2)=> t1 < t2 ? -1 : (t1 > t2 ? 1 : 0)); + } + class NiceComparator<-T> implements java.util.Comparator<T> { |
From: Bryn K. <xo...@us...> - 2004-05-24 18:47:11
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22347/stdlib/nice/lang Modified Files: collections.nice Log Message: Added listToMap, putAll and removeAll for Maps. Implemented similarEmptyCollection for HashMap.Values. Added a foldLeft variant that uses the first element of the list as the starter. Index: collections.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/collections.nice,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** collections.nice 24 May 2004 17:04:42 -0000 1.65 --- collections.nice 24 May 2004 18:47:02 -0000 1.66 *************** *** 85,88 **** --- 85,97 ---- } + <T> T foldLeft(List<T> list, (T,T)->T func) + { + Iterator<T> iter = list.iterator(); + T res = iter.next(); + while(iter.hasNext()) + res = func(res, iter.next()); + return res; + } + <T, U> U foldRight(List<T> list, (T, U)->U func, U init) = foldRight(list, func, init, 0); *************** *** 155,158 **** --- 164,170 ---- similarEmptyCollection(c#HashSet) = new HashSet(c.size()); + + similarEmptyCollection(c#HashMap.Values) = new ArrayList(c.size()); + /**************************************************************** * Sort *************** *** 470,471 **** --- 482,505 ---- fun(entry.getKey(), entry.getValue()); } + + <K,V> Map<K,V> listToMap(List<(K,V)> list) + { + let Map<K,V> map = new HashMap(); + map.putAll(list); + return map; + } + + <K,V> void putAll(Map<K,V> map, List<(K,V)> list) + { + for((K,V) tup:list) { + (K key, V val) = tup; + map.put(key, val); + } + } + + <K,V> void removeAll(Map<K,V> map, List<K> list) + { + for(K key:list) { + map.remove(key); + } + } |
From: Bryn K. <xo...@us...> - 2004-05-24 17:04:52
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29284/stdlib/nice/lang Modified Files: collections.nice Log Message: Lifted search and find to work on Collection<T> instead of List<T>. Index: collections.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/collections.nice,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** collections.nice 14 Apr 2004 12:51:57 -0000 1.64 --- collections.nice 24 May 2004 17:04:42 -0000 1.65 *************** *** 239,245 **** @throw java.util.NoSuchElementException if there is no such element. */ ! <T> T find (List<T> list, T->boolean test) { ! for (T elem : list) if (test(elem)) return elem; --- 239,245 ---- @throw java.util.NoSuchElementException if there is no such element. */ ! <T> T find (Collection<T> collection, T->boolean test) { ! for (T elem : collection) if (test(elem)) return elem; *************** *** 263,269 **** Returns <code>null</code> if there is no such element. */ ! <T> ?T search (java.util.List<!T> list, !T->boolean test) { ! for (!T elem : list) if (test(elem)) return elem; --- 263,269 ---- Returns <code>null</code> if there is no such element. */ ! <T> ?T search (java.util.Collection<!T> collection, !T->boolean test) { ! for (!T elem : collection) if (test(elem)) return elem; |
From: <ben...@id...> - 2004-05-22 12:24:31
|
Dear Open Source developer I am doing a research project on "Fun and Software Development" in which I kindly invite you to participate. You will find the online survey under http://fasd.ethz.ch/qsf/. The questionnaire consists of 53 questions and you will need about 15 minutes to complete it. With the FASD project (Fun and Software Development) we want to define the motivational significance of fun when software developers decide to engage in Open Source projects. What is special about our research project is that a similar survey is planned with software developers in commercial firms. This procedure allows the immediate comparison between the involved individuals and the conditions of production of these two development models. Thus we hope to obtain substantial new insights to the phenomenon of Open Source Development. With many thanks for your participation, Benno Luthiger PS: The results of the survey will be published under http://www.isu.unizh.ch/fuehrung/blprojects/FASD/. We have set up the mailing list fa...@we... for this study. Please see http://fasd.ethz.ch/qsf/mailinglist_en.html for registration to this mailing list. _______________________________________________________________________ Benno Luthiger Swiss Federal Institute of Technology Zurich 8092 Zurich Mail: benno.luthiger(at)id.ethz.ch _______________________________________________________________________ |
From: Bryn K. <xo...@us...> - 2004-05-21 17:01:19
|
Update of /cvsroot/nice/Nice/stdlib/nice/getopt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31864/stdlib/nice/getopt Modified Files: getopt.nice Log Message: Updated getopt to use the 'search' function, since 'find' now throws an exception when the item isn't in the list. Index: getopt.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/getopt/getopt.nice,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** getopt.nice 29 Jul 2003 00:22:07 -0000 1.21 --- getopt.nice 21 May 2004 17:01:08 -0000 1.22 *************** *** 52,56 **** while (c != noOptionsLeft) { ! ?Option chosen = options.find(Option o => o.optval == c); if (chosen != null) chosen.doAction(g); --- 52,56 ---- while (c != noOptionsLeft) { ! ?Option chosen = options.search(Option o => o.optval == c); if (chosen != null) chosen.doAction(g); |
From: Daniel B. <bo...@us...> - 2004-05-07 09:01:13
|
Update of /cvsroot/nice/tester In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11695 Modified Files: run Log Message: Quite update Index: run =================================================================== RCS file: /cvsroot/nice/tester/run,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** run 7 May 2004 08:53:19 -0000 1.11 --- run 7 May 2004 09:01:02 -0000 1.12 *************** *** 9,13 **** # We first update the tester code, then start a new copy of this file # (since it might have been updated). ! if cvs update; then exec "$0" updated else --- 9,13 ---- # We first update the tester code, then start a new copy of this file # (since it might have been updated). ! if cvs -q update; then exec "$0" updated else |
From: Daniel B. <bo...@us...> - 2004-05-07 08:58:25
|
Update of /cvsroot/nice/tester In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11056 Modified Files: .cvsignore Added Files: bench config-bench Log Message: Historical benchmarking Index: .cvsignore =================================================================== RCS file: /cvsroot/nice/tester/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .cvsignore 7 May 2004 08:53:19 -0000 1.2 --- .cvsignore 7 May 2004 08:58:03 -0000 1.3 *************** *** 4,5 **** --- 4,6 ---- METRICS *.metrics + benchs --- NEW FILE: config-bench --- export JAVA_HOME=/usr/local/opt/j2sdk1.4.2 export JDK_VERSION=1.4.2 --- NEW FILE: bench --- #! /bin/sh -x # Automatic Benchmarker # Stop on errors set -e # Set up variables, that can be overriden in the setup file. machine="`hostname -f`" system="`uname -a`" user="$USER" export CVS_SOURCEFORGE="cvs.sourceforge.net" if [ -r setup ]; then . setup fi #rm -rf benchs; mkdir -p benchs cd benchs ../cvs-master Nice checkout wget -O Nice/external/nice-bootstrap.jar http://nice.sf.net/nice.jar . ../config-bench export NICEC=${PWD}/Nice/bin/nicec export NICE_JAR=${PWD}/Nice/share/java/nice.jar ORIGINAL_PATH="$PATH" PATH="$JAVA_HOME/bin:$ORIGINAL_PATH" # Redirect output exec > bench.log exec 2>&1 days=1 while true; do if cd Nice; cvs update -d -D "$days days ago"; make complete; cd ..; then /usr/bin/time -f "$days ago: %Uu %Ss" -a -o ../bench.res ../Swing.test else echo "Bootstrap FAILURE" fi days=$((days + 1)) done |
From: Daniel B. <bo...@us...> - 2004-05-07 08:54:47
|
Update of /cvsroot/nice/tester In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10396 Modified Files: Project Added Files: Regression.test Testsuite.test Log Message: Separated testing from building --- NEW FILE: Testsuite.test --- #! /bin/sh cd Nice /usr/bin/time -o TIME make check > OUT RES=$? # print for the log cat OUT NUM_PREFIX="number of testcases: " NUM=`tail -10 OUT | grep "$NUM_PREFIX"` NUM=`expr match "$NUM" "$NUM_PREFIX"'\(.*\)'` echo num_tests $NUM time `cat TIME` > ../METRICS exit $RES Index: Project =================================================================== RCS file: /cvsroot/nice/tester/Project,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Project 24 Nov 2003 22:26:21 -0000 1.9 --- Project 7 May 2004 08:54:37 -0000 1.10 *************** *** 6,11 **** if [ ! -r Nice ]; then ../cvs Nice || exit 3 ! wget -O Nice/external/nice-bootstrap.jar http://nice.sf.net/nice.jar || exit 3 fi ! cd Nice && make universe --- 6,16 ---- if [ ! -r Nice ]; then ../cvs Nice || exit 3 ! wget --cache=no -O Nice/external/nice-bootstrap.jar http://nice.sf.net/nice.jar || exit 3 fi ! # In benchmark mode, don't run the testsuite ! if [ "$CVS_DATE" ]; then ! cd Nice && make ! else ! cd Nice && make fixpoint && cp share/java/nice.jar external/nice-bootstrap.jar && make fixpoint ! fi --- NEW FILE: Regression.test --- #! /bin/sh cd Nice /usr/bin/time -o TIME make test > OUT RES=$? # print for the log cat OUT #NUM_PREFIX="number of testcases: " #NUM=`tail -10 OUT | grep "$NUM_PREFIX"` #NUM=`expr match "$NUM" "$NUM_PREFIX"'\(.*\)'` echo time `cat TIME` > ../METRICS exit $RES |
From: Daniel B. <bo...@us...> - 2004-05-07 08:53:29
|
Update of /cvsroot/nice/tester In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10122 Modified Files: .cvsignore run Log Message: Store test metrics Index: .cvsignore =================================================================== RCS file: /cvsroot/nice/tester/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .cvsignore 28 Apr 2003 11:44:44 -0000 1.1 --- .cvsignore 7 May 2004 08:53:19 -0000 1.2 *************** *** 2,3 **** --- 2,5 ---- config.* setup + METRICS + *.metrics Index: run =================================================================== RCS file: /cvsroot/nice/tester/run,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** run 24 Nov 2003 22:26:21 -0000 1.10 --- run 7 May 2004 08:53:19 -0000 1.11 *************** *** 83,90 **** --- 83,98 ---- echo "" + rm -f METRICS + set +e $test code=$? set -e + + if [ -r METRICS ]; then + echo -n "`date +'%F %R'` " >> ../$testname.metrics + cat METRICS >> ../$testname.metrics + fi + { echo -n "$testname " |
From: Francis B. <fb...@us...> - 2004-04-27 12:57:02
|
Update of /cvsroot/nice/Nice/src/nice/tools/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24355/Nice/src/nice/tools/doc Modified Files: comment.nice Log Message: Added nicedoc comments. Index: comment.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/doc/comment.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** comment.nice 25 Apr 2004 16:25:28 -0000 1.1 --- comment.nice 27 Apr 2004 12:56:52 -0000 1.2 *************** *** 13,16 **** --- 13,23 ---- package nice.tools.doc; + /** + * The comment class is an abstraction of a comment block. It contains an + * instance variable <i>tags</i> contains an ArrayList of tuples that map tag + * strings to values. The value <b>null</b> maps to the general comment. + * The constructor of this class should be used put a comment block in + * <i>commentStr</i> (the default value is the empty string. + */ class Comment { //a list of tuples that maps tags, such as @param, to values *************** *** 25,28 **** --- 32,42 ---- } + /** + * Parses a comment block and returns an ArrayList containing tuples that map + * tag string (such as @param) to values. The value <b>null</b> is used as the + * parameter for the general comment heading the block. + * @param a comment block beginning with /** and ending with */ + * @return a list of tuples mapping tags to values. + */ ArrayList<(?String,String)> parse(String comments) { //an initial capacity of 8 is used becuase I don't expect many values |
From: Francis B. <fb...@us...> - 2004-04-25 18:28:03
|
Update of /cvsroot/nice/Nice/src/nice/tools/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25752/src/nice/tools/doc Modified Files: document.nice Log Message: superClass variable might be null. This is now reflected in its declaration. Index: document.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/doc/document.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** document.nice 13 Feb 2004 15:14:08 -0000 1.1 --- document.nice 25 Apr 2004 16:21:31 -0000 1.2 *************** *** 43,47 **** println("Class " + c.getName); ! ClassDefinition superClass = c.getSuperClassDefinition(); if (superClass != null) println(" extends " + superClass.getName()); --- 43,47 ---- println("Class " + c.getName); ! ?ClassDefinition superClass = c.getSuperClassDefinition(); if (superClass != null) println(" extends " + superClass.getName()); |
From: Francis B. <fb...@us...> - 2004-04-25 16:29:21
|
Update of /cvsroot/nice/Nice/src/nice/tools/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26406/src/nice/tools/doc Added Files: comment.nice Log Message: This class is used to store and pass comment strings. This is the initial check-in. --- NEW FILE: comment.nice --- /**************************************************************************/ /* 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 nice.tools.doc; class Comment { //a list of tuples that maps tags, such as @param, to values //this value is initialised by the custom constructor ArrayList<(?String,String)> tags = cast(null); String commentStr = ""; /*Initialisation*/ { tags = parse(commentStr); } } ArrayList<(?String,String)> parse(String comments) { //an initial capacity of 8 is used becuase I don't expect many values ArrayList<(?String,String)> list = new ArrayList(8); StringBuffer buf = new StringBuffer(comments); //the first and last chars should be '/' if(buf.charAt(0) == '/' && buf.charAt(buf.length() - 1) == '/') { buf.deleteCharAt(0); buf.deleteCharAt(buf.length()-1); } //else do something for(int i = 0; i < buf.length; /*no increment*/) { if(buf.charAt(i) == '*' && (i == 0 || buf.charAt(i-1) == '\n')) { buf.deleteCharAt(i); } else { i++; } } for(int i = 0; i < buf.length; i++) { if(buf.charAt(i) == '\n') { buf.replace(i, i+1, " "); } } StringTokenizer st = new StringTokenizer(buf.toString(), "@", true /*return delimiters*/); boolean isParam = false; for(int i = 0; st.hasMoreTokens(); i++) { //println("\"Token " i ": " st.nextToken().trim() "\""); String token = st.nextToken().trim(); if(token.equals("@")) { //the next token will be a param string isParam = true; } else if(isParam) { /*this token will have the form "<param name> <comment string>" *extract the param name and insert it as the key. add the rest as a comment */ int index = token.indexOf(' '); list.add(("@" token.substring(0, index), token.substring(index+1))); isParam = false; } else { //this is a general comment list.add((null, token)); } } return list; } |
From: Francis B. <fb...@us...> - 2004-04-25 16:22:58
|
Update of /cvsroot/nice/Nice/src/nice/tools/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25368/src/nice/tools/doc Modified Files: main.nice Log Message: Removed superfluous variable "classpath" Index: main.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/doc/main.nice,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** main.nice 14 Mar 2004 14:49:36 -0000 1.5 --- main.nice 25 Apr 2004 16:19:01 -0000 1.6 *************** *** 15,19 **** { String mainPackage; - ?String classpath = null; File outdir = new File("."); --- 15,18 ---- |
From: Daniel B. <bo...@us...> - 2004-04-22 10:09:39
|
Update of /cvsroot/nice/Nice/src/mlsub/typing/lowlevel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8357/src/mlsub/typing/lowlevel Modified Files: Engine.java Log Message: Disable refreeing of former free variables after failed overloading, since it triggers a bug and does not seem to help in any known case. Index: Engine.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/Engine.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Engine.java 26 Mar 2004 10:48:38 -0000 1.32 --- Engine.java 22 Apr 2004 10:09:29 -0000 1.33 *************** *** 157,160 **** --- 157,161 ---- frozenLeqs.backtrack(); + /* if (tentative && !commit) { *************** *** 173,176 **** --- 174,178 ---- } } + */ } |
From: Daniel B. <bo...@us...> - 2004-04-22 10:09:38
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8357/testsuite/compiler/typing Modified Files: inference.testsuite Log Message: Disable refreeing of former free variables after failed overloading, since it triggers a bug and does not seem to help in any known case. Index: inference.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/typing/inference.testsuite,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** inference.testsuite 26 Mar 2004 16:15:38 -0000 1.7 --- inference.testsuite 22 Apr 2004 10:09:27 -0000 1.8 *************** *** 199,200 **** --- 199,245 ---- for(i : testmap.keySet()) println(i + " => " + testmap[i]); + + /// PASS + // bug #923429 + var n = 1; + let nKeys = 10000; + + let table1 = new HashMap(nKeys); + let table2 = new HashMap(); + for (int i = 0; i <= nKeys; i++) + table1["foo_" + i] = new Cell(value: i); + + String key; + int v1; + ?Cell c2; + + while (n-- > 0) + for (each : table1.entrySet) { + key = each.getKey; + v1 = each.getValue.value; + + if ( (c2 = table2[key]) != null) + c2.value += v1; + else + table2[key] = new Cell(value: v1); //HERE + } + /// Toplevel + class Cell { int value; } + toString(Cell c) = c.value.toString; + + /// PASS + // bug #923429 simplified + let table1 = new HashMap(); + let table2 = new HashMap(); + + ?Cell c2; + + for (each : table1.entrySet) + { + let key = each.getKey; + c2 = table2[key]; + table2[key] = new Cell(value: each.getValue.value); + } + /// Toplevel + + class Cell { int value; } |
From: Arjan B. <ar...@us...> - 2004-04-19 11:10:25
|
Update of /cvsroot/nice/Nice/stdlib/nice/functional In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15452/F:/nice/stdlib/nice/functional Modified Files: generator.nice iterator.nice Log Message: Added package declaration. Index: iterator.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/functional/iterator.nice,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** iterator.nice 27 Jan 2004 17:37:20 -0000 1.2 --- iterator.nice 19 Apr 2004 11:10:14 -0000 1.3 *************** *** 15,18 **** --- 15,19 ---- * terms of your choice. * ****************************************************************************/ + package nice.functional; /** Index: generator.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/functional/generator.nice,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** generator.nice 27 Jan 2004 17:37:19 -0000 1.2 --- generator.nice 19 Apr 2004 11:10:14 -0000 1.3 *************** *** 15,18 **** --- 15,19 ---- * terms of your choice. * ****************************************************************************/ + package nice.functional; /** |
From: Arjan B. <ar...@us...> - 2004-04-17 17:12:20
|
Update of /cvsroot/nice/Nice/src/mlsub/typing/lowlevel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6961/F:/nice/src/mlsub/typing/lowlevel Modified Files: BitVector.java Log Message: Reapplied a part of the optimizations of cvs version 1.5 Index: BitVector.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/BitVector.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** BitVector.java 26 Mar 2004 16:03:19 -0000 1.9 --- BitVector.java 17 Apr 2004 17:12:11 -0000 1.10 *************** *** 359,365 **** n = bits2length; } ! int bits3length = S3.length(); ! for (int i = 0; i < n; i++) { ! andW(i, ~(S1.getW(i) & S2.getW(i)) | (i < bits3length ? S3.getW(i) : 0L)); } } --- 359,379 ---- n = bits2length; } ! ! if (n<=1) ! { ! andW(0, ~(S1.getW(0) & S2.getW(0)) | S3.getW(0)); ! } ! else ! { ! int bits3length = S3.length(); ! if (bits3length > n) { ! bits3length = n; ! } ! ! for (int i = 0; i < bits3length; i++) ! bits1[i] &= ~(S1.bits1[i] & S2.bits1[i]) | S3.getW(i); ! ! for (int i = bits3length; i < n; i++) ! bits1[i] &= ~(S1.bits1[i] & S2.bits1[i]); } } *************** *** 373,381 **** } int setLength = set.nonZeroLength(); ! if (setLength > 0) { ! ensureCapacity(bitIndex(setLength-1));// this might cause some problem... } ! for (int i = setLength; i-- > 0 ;) { ! orW(i, set.getW(i)); } } --- 387,399 ---- } int setLength = set.nonZeroLength(); ! if (setLength > 1) { ! ensureCapacity(bitIndex(setLength-1)); ! for (int i = setLength; i-- > 0 ;) { ! bits1[i] |= set.bits1[i]; ! } } ! else ! { ! orW(0, set.getW(0)); } } *************** *** 591,606 **** static /* XXX: work around Symantec JIT bug: comment static */ int chunkLowestSetBit(long chunk) { ! if (chunk == 0L) { ! return 64; ! } else { ! int bit = 0; ! if ((chunk & 0xffffffffL) == 0) { bit += 32; chunk >>>= 32; } ! if ((chunk & 0xffffL) == 0) { bit += 16; chunk >>>= 16; } ! if ((chunk & 0xffL) == 0) { bit += 8; chunk >>>= 8; } ! if ((chunk & 0xfL) == 0) { bit += 4; chunk >>>= 4; } ! if ((chunk & 0x3L) == 0) { bit += 2; chunk >>>= 2; } ! if ((chunk & 0x1L) == 0) { bit++; } ! return bit; ! } } --- 609,621 ---- static /* XXX: work around Symantec JIT bug: comment static */ int chunkLowestSetBit(long chunk) { ! int bit = 0; ! chunk &= -chunk; //fix sign bit ! if ((chunk & 0xffffffff00000000L) != 0 ) bit += 32; ! if ((chunk & 0xffff0000ffff0000L) != 0 ) bit += 16; ! if ((chunk & 0xff00ff00ff00ff00L) != 0 ) bit += 8; ! if ((chunk & 0xf0f0f0f0f0f0f0f0L) != 0 ) bit += 4; ! if ((chunk & 0xccccccccccccccccL) != 0 ) bit += 2; ! if ((chunk & 0xaaaaaaaaaaaaaaaaL) != 0 ) bit += 1; ! return bit; } *************** *** 612,620 **** **/ final public int getLowestSetBit() { ! int n = length(); ! for (int i = 0; i < n; i++) { ! long chunk = getW(i); ! if (chunk != 0L) { ! return (i << BITS_PER_UNIT) + chunkLowestSetBit(chunk); } } --- 627,642 ---- **/ final public int getLowestSetBit() { ! if (bits1 == null) ! { ! if (bits0 != 0L) ! return chunkLowestSetBit(bits0); ! } ! else ! { ! int n = bits1.length; ! for (int i = 0; i < n; i++) { ! long chunk = bits1[i]; ! if (chunk != 0L) ! return (i << BITS_PER_UNIT) + chunkLowestSetBit(chunk); } } *************** *** 658,662 **** return UNDEFINED_INDEX; } ! chunk = getW(i); } } --- 680,684 ---- return UNDEFINED_INDEX; } ! chunk = bits1[i]; } } *************** *** 668,677 **** **/ public int getNextBit(int i) { ! int result = getLowestSetBit(i + 1); ! if (result < 0) { ! return UNDEFINED_INDEX; ! } else { ! return result; ! } } --- 690,694 ---- **/ public int getNextBit(int i) { ! return getLowestSetBit(i + 1); } |
From: Daniel B. <bo...@us...> - 2004-04-16 13:55:39
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5487/src/bossa/syntax Modified Files: NewArrayExp.java Log Message: Remove obsolete commented code left by accident. Index: NewArrayExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/NewArrayExp.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** NewArrayExp.java 16 Apr 2004 12:28:37 -0000 1.21 --- NewArrayExp.java 16 Apr 2004 13:55:29 -0000 1.22 *************** *** 91,119 **** else monotype = res; - /* - TypeConstructor tc = new TypeConstructor("nullness", PrimitiveType.maybeTC.variance, false, false); - MonotypeVar raw = new MonotypeVar(res.getName()+"raw"); - MonotypeConstructor eq = MonotypeConstructor.apply(tc, raw); - TypeSymbol[] vars; - if (nullVars == null) - vars = new TypeSymbol[]{tc, raw}; - else - { - vars = new TypeSymbol[nullVars.length + 2]; - System.arraycopy(nullVars, 0, vars, 2, nullVars.length); - vars[0] = tc; - vars[1] = raw; - } - cst = new Constraint(vars, new AtomicConstraint[]{ - new TypeConstructorLeqCst(tc, PrimitiveType.maybeTC), - new MonotypeLeqCst(eq, res), - new MonotypeLeqCst(res, eq)}); - - if (nullVars != null) - monotype = MonotypeConstructor.apply(nullVars[nullVars.length - 1], - raw); - else - monotype = bossa.syntax.Monotype.maybe(raw); - */ } else if (resolvedType == mlsub.typing.TopMonotype.instance) --- 91,94 ---- |
From: Arjan B. <ar...@us...> - 2004-04-16 13:17:12
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28485/F:/nice/src/bossa/syntax Modified Files: ClassDefinition.java Log Message: Give an user error when trying to extend a primitive. fixes #910778 Index: ClassDefinition.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/ClassDefinition.java,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** ClassDefinition.java 11 Feb 2004 12:46:39 -0000 1.103 --- ClassDefinition.java 16 Apr 2004 13:16:59 -0000 1.104 *************** *** 289,294 **** ClassDefinition d = getSuperClassDefinition(); if (d != null) ! d.resolve(); super.resolveClass(); } --- 289,299 ---- ClassDefinition d = getSuperClassDefinition(); if (d != null) ! { ! d.resolve(); + if(d.getImplementation() instanceof PrimitiveType && ! + (this.getImplementation() instanceof PrimitiveType)) + User.error(this, "A class can't extends a primitive"); + } super.resolveClass(); } |
From: Arjan B. <ar...@us...> - 2004-04-16 12:28:50
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18419/F:/nice/src/bossa/syntax Modified Files: NewArrayExp.java Log Message: Make it compile. Index: NewArrayExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/NewArrayExp.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** NewArrayExp.java 15 Apr 2004 14:42:01 -0000 1.20 --- NewArrayExp.java 16 Apr 2004 12:28:37 -0000 1.21 *************** *** 116,120 **** monotype = bossa.syntax.Monotype.maybe(raw); */ - } } else if (resolvedType == mlsub.typing.TopMonotype.instance) --- 116,119 ---- |
From: Daniel B. <bo...@us...> - 2004-04-15 14:42:15
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31726/src/bossa/syntax Modified Files: NewArrayExp.java Log Message: Simpler and more flexible typing for 'new T[x]': that expression now has type ?T, unless T is already known to be a complete, non-raw type. Index: NewArrayExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/NewArrayExp.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** NewArrayExp.java 25 Feb 2004 11:23:29 -0000 1.19 --- NewArrayExp.java 15 Apr 2004 14:42:01 -0000 1.20 *************** *** 59,63 **** { Monotype monotype; ! Constraint cst; TypeConstructor[] nullVars; --- 59,63 ---- { Monotype monotype; ! Constraint cst = Constraint.True; TypeConstructor[] nullVars; *************** *** 79,124 **** else nullVars = null; ! if (resolvedType instanceof MonotypeVar) { MonotypeVar res = (MonotypeVar) resolvedType; - TypeConstructor tc = new TypeConstructor("nullness", PrimitiveType.maybeTC.variance, false, false); - MonotypeVar raw = new MonotypeVar(res.getName()+"raw"); - MonotypeConstructor eq = MonotypeConstructor.apply(tc, raw); - TypeSymbol[] vars; - if (nullVars == null) - vars = new TypeSymbol[]{tc, raw}; - else - { - vars = new TypeSymbol[nullVars.length + 2]; - System.arraycopy(nullVars, 0, vars, 2, nullVars.length); - vars[0] = tc; - vars[1] = raw; - } - cst = new Constraint(vars, new AtomicConstraint[]{ - new TypeConstructorLeqCst(tc, PrimitiveType.maybeTC), - new MonotypeLeqCst(eq, res), - new MonotypeLeqCst(res, eq)}); ! if (nullVars != null) ! monotype = MonotypeConstructor.apply(nullVars[nullVars.length - 1], ! raw); ! else ! monotype = bossa.syntax.Monotype.maybe(raw); } else if (resolvedType == mlsub.typing.TopMonotype.instance) { monotype = mlsub.typing.TopMonotype.instance; - if (nullVars != null) - { - monotype = MonotypeConstructor.apply(nullVars[nullVars.length - 1], - monotype); - cst = new Constraint(nullVars, null); - } - else - { - monotype = bossa.syntax.Monotype.maybe(monotype); - cst = Constraint.True; - } } else --- 79,124 ---- else nullVars = null; ! ! // Whether the element are surely not null ! boolean sure = false; ! if (resolvedType instanceof MonotypeVar) { MonotypeVar res = (MonotypeVar) resolvedType; ! if (res.getKind() == mlsub.typing.NullnessKind.instance) ! monotype = Types.rawType(res.equivalent()); ! else ! monotype = res; ! /* ! TypeConstructor tc = new TypeConstructor("nullness", PrimitiveType.maybeTC.variance, false, false); ! MonotypeVar raw = new MonotypeVar(res.getName()+"raw"); ! MonotypeConstructor eq = MonotypeConstructor.apply(tc, raw); ! TypeSymbol[] vars; ! if (nullVars == null) ! vars = new TypeSymbol[]{tc, raw}; ! else ! { ! vars = new TypeSymbol[nullVars.length + 2]; ! System.arraycopy(nullVars, 0, vars, 2, nullVars.length); ! vars[0] = tc; ! vars[1] = raw; ! } ! cst = new Constraint(vars, new AtomicConstraint[]{ ! new TypeConstructorLeqCst(tc, PrimitiveType.maybeTC), ! new MonotypeLeqCst(eq, res), ! new MonotypeLeqCst(res, eq)}); ! ! if (nullVars != null) ! monotype = MonotypeConstructor.apply(nullVars[nullVars.length - 1], ! raw); ! else ! monotype = bossa.syntax.Monotype.maybe(raw); ! */ ! } } else if (resolvedType == mlsub.typing.TopMonotype.instance) { monotype = mlsub.typing.TopMonotype.instance; } else *************** *** 126,146 **** if (!(resolvedType instanceof TypeConstructor)) User.error(ident, ident + " should be a class"); - - cst = Constraint.True; TypeConstructor tc = (TypeConstructor) resolvedType; monotype = new MonotypeConstructor(tc, MonotypeVar.news(tc.arity())); if (Types.isPrimitive(tc)) ! monotype = bossa.syntax.Monotype.sure(monotype); ! else if (nullVars != null) ! { ! monotype = MonotypeConstructor.apply(nullVars[nullVars.length - 1], ! monotype); ! cst = new Constraint(nullVars, null); ! } ! else ! monotype = bossa.syntax.Monotype.maybe(monotype); } ! for (int i = 0; i < unknownDimensions; i++) { --- 126,149 ---- if (!(resolvedType instanceof TypeConstructor)) User.error(ident, ident + " should be a class"); TypeConstructor tc = (TypeConstructor) resolvedType; monotype = new MonotypeConstructor(tc, MonotypeVar.news(tc.arity())); + if (Types.isPrimitive(tc)) ! sure = true; } ! ! // Add the nullness marker to the element type. ! if (sure) ! monotype = bossa.syntax.Monotype.sure(monotype); ! else if (nullVars == null) ! monotype = bossa.syntax.Monotype.maybe(monotype); ! else ! { ! monotype = MonotypeConstructor.apply ! (nullVars[nullVars.length - 1], monotype); ! cst = new Constraint(nullVars, null); ! } ! for (int i = 0; i < unknownDimensions; i++) { |
From: Daniel B. <bo...@us...> - 2004-04-15 14:42:15
|
Update of /cvsroot/nice/Nice/testsuite/compiler/expressions/arrays In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31726/testsuite/compiler/expressions/arrays Modified Files: typing.testsuite Log Message: Simpler and more flexible typing for 'new T[x]': that expression now has type ?T, unless T is already known to be a complete, non-raw type. Index: typing.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/expressions/arrays/typing.testsuite,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** typing.testsuite 9 May 2003 11:57:37 -0000 1.2 --- typing.testsuite 15 Apr 2004 14:42:00 -0000 1.3 *************** *** 12,13 **** --- 12,18 ---- /// FAIL new int[""]; + + /// PASS + /// Toplevel + <T> ?T[] foo(!T x) = new T[1]; + <T> ?T[] foo2(int length) = new T[length]; |