[Nice-commit] Nice/stdlib/nice/lang collections.nice,1.57,1.58
Brought to you by:
bonniot
From: <ar...@us...> - 2003-12-16 14:55:32
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1:/tmp/cvs-serv8382/F:/nice/stdlib/nice/lang Modified Files: collections.nice Log Message: Added foreach on Maps. Index: collections.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/collections.nice,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** collections.nice 19 Nov 2003 16:04:46 -0000 1.57 --- collections.nice 16 Dec 2003 14:55:28 -0000 1.58 *************** *** 467,468 **** --- 467,478 ---- return res; } + + /**************************************************************** + * Map operations + ****************************************************************/ + + <K,V> void foreach(Map<K,V> map, (K,V)->void fun) + { + for (Map.Entry<K,V> entry : map.entrySet()) + fun(entry.getKey(), entry.getValue()); + } |