[Nice-commit] Nice/stdlib/nice/lang slice.nice,1.1,1.2 ForInIters.nice,1.9,1.10
Brought to you by:
bonniot
From: Daniel B. <bo...@us...> - 2004-09-15 19:20:34
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14902/stdlib/nice/lang Modified Files: slice.nice ForInIters.nice Log Message: Make sure that finite literal ranges have a static subtype of List. Index: ForInIters.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/ForInIters.nice,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ForInIters.nice 15 Sep 2004 17:46:55 -0000 1.9 --- ForInIters.nice 15 Sep 2004 19:20:25 -0000 1.10 *************** *** 28,31 **** --- 28,34 ---- Iterator<int> forIterator(OpenRange<int> range) = range.openIterator(); + // Resolve the ambiguity for Ranges + override Iterator<int> forIterator(Range<int> range) = range.openIterator(); + //The implementations of additional Iterators /* Index: slice.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/slice.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** slice.nice 13 Aug 2004 06:24:39 -0000 1.1 --- slice.nice 15 Sep 2004 19:20:25 -0000 1.2 *************** *** 58,73 **** } ! public OpenRange<int> `..`(int begin, ?int end) requires end == null || end >= 0, ! begin >= 0 { let beginIndex = new Index(index: begin, relativeToEnd: false); ! let endIndex = end == null ? ! new Index(index: 0, relativeToEnd: true) ! :new Index(index: end, relativeToEnd: false); ! if (end == null) ! return new OpenRange(begin: beginIndex, end: endIndex); ! else ! return new Range(begin: beginIndex, end: endIndex); } --- 58,77 ---- } ! public OpenRange<int> `..`(int begin, ?int end) requires end == null || end >= 0, ! begin >= 0; ! ! `..`(int begin, null) { let beginIndex = new Index(index: begin, relativeToEnd: false); ! let endIndex = new Index(index: 0, relativeToEnd: true); ! return new OpenRange(begin: beginIndex, end: endIndex); ! } ! ! public override Range<int> `..`(int begin, int end) ! { ! let beginIndex = new Index(index: begin, relativeToEnd: false); ! let endIndex = new Index(index: end, relativeToEnd: false); ! return new Range(begin: beginIndex, end: endIndex); } |