[pure-lang-svn] SF.net SVN: pure-lang: [402] pure/trunk/examples/dict.pure
Status: Beta
Brought to you by:
agraef
From: <js...@us...> - 2008-07-06 21:20:08
|
Revision: 402 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=402&view=rev Author: jspitz Date: 2008-07-06 14:20:06 -0700 (Sun, 06 Jul 2008) Log Message: ----------- Bugfix of 'mkdict', 'mkhdict' and 'update' to use '=>' operator. Modified Paths: -------------- pure/trunk/examples/dict.pure Modified: pure/trunk/examples/dict.pure =================================================================== --- pure/trunk/examples/dict.pure 2008-07-06 17:37:53 UTC (rev 401) +++ pure/trunk/examples/dict.pure 2008-07-06 21:20:06 UTC (rev 402) @@ -285,8 +285,8 @@ // create dict or hdict from a list of keys and a constant value -mkdict y xs = dict (zip xs (repeat (#xs) y)) if listp xs; -mkhdict y xs = hdict (zip xs (repeat (#xs) y)) if listp xs; +mkdict y xs = dict (zipwith (=>) xs (repeat (#xs) y)) if listp xs; +mkhdict y xs = hdict (zipwith (=>) xs (repeat (#xs) y)) if listp xs; // check for the empty dict or hdict null (Dict nil) = 1; @@ -458,7 +458,7 @@ update d@(Dict _) x::string y | update d@(Dict _) x y | update d@(Hdict _) x y - = insert d [x, y]; + = insert d (x => y); // equality checks for dict and hdict d1@(Dict _) == d2@(Dict _) = (members d1) == (members d2); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |