[Nice-commit] Nice NEWS,1.43,1.44
Brought to you by:
bonniot
From: Bryn K. <xo...@us...> - 2004-08-13 06:24:48
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24699 Modified Files: NEWS Log Message: Added new [] overloads for lists - slicing, relative-to-end indexing, filters, etc. Index: NEWS =================================================================== RCS file: /cvsroot/nice/Nice/NEWS,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** NEWS 12 Aug 2004 23:43:21 -0000 1.43 --- NEWS 13 Aug 2004 06:24:38 -0000 1.44 *************** *** 23,26 **** --- 23,45 ---- * Improved speed of coverage tests for some methods. * Removed the '--strict' compiler option. + * Lists now support a wide array of slicing and indexing + operations. There is a new bit of syntax, '@', which indicates + the index of the last item in a list, which can be used for working + with indexes relative to the end of the list, instead of the beginning. + + For instance, given a list of ints from 0 to 6 called + 'intList': + intList[@] is 6, + intList[@-1] is 5, + intList[1..2] is the list [1,2]. + intList[1..@-1] is a list of all but the first and last + elements of ints, i.e., [1,2,3,4,5] + intList[1..] is a list of all but the first element of intList + intList[..] is a complete copy of intList + intList[..@-1] is a list of all but the last element of intList + intList[int i => i % 2 == 0] is a list of all the even ints + in intList: [0,2,4,6] + Several more options are available, an update to the manual will + reflect this. -- |