Update of /cvsroot/nice/Nice/stdlib/nice/lang
In directory sc8-pr-cvs1:/tmp/cvs-serv27909/stdlib/nice/lang
Modified Files:
array.nice
Log Message:
Make use of the possibility for a default value to refer to previous params.
Index: array.nice
===================================================================
RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/array.nice,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** array.nice 24 Aug 2003 20:47:57 -0000 1.26
--- array.nice 25 Aug 2003 17:27:10 -0000 1.27
***************
*** 79,89 ****
}
! <Any T> T[] slice(T[] array, int from = 0, int to = -1)
! {
! if (to == -1)
! to = array.length - 1;
!
! return fill(new T[to - from + 1], int i => array[i + from]);
! }
// Define collection methods
--- 79,84 ----
}
! <T> T[] slice(T[] array, int from = 0, int to = array.length - 1) =
! fill(new T[to - from + 1], int i => array[i + from]);
// Define collection methods
|