SCM Repository
[smlnj] / smlnj-lib / trunk / Util / int-list-map.sml |
Diff of /smlnj-lib/trunk/Util/int-list-map.sml
Parent Directory
|
Revision Log
|
Patch
revision 2273, Tue Jan 30 14:59:09 2007 UTC | revision 2274, Tue Jan 30 15:00:09 2007 UTC | |
---|---|---|
# | Line 63 | Line 63 |
63 | f l | f l |
64 | end | end |
65 | ||
66 | (* Look for an item, raise NotFound if the item doesn't exist *) | |
67 | fun lookup (l, key) = let | |
68 | fun f [] = raise LibBase.NotFound | |
69 | | f ((key', x) :: r) = | |
70 | if (key < key') then raise LibBase.NotFound | |
71 | else if (key = key') then x | |
72 | else f r | |
73 | in | |
74 | f l | |
75 | end | |
76 | ||
77 | (* Remove an item, returning new map and value removed. | (* Remove an item, returning new map and value removed. |
78 | * Raise LibBase.NotFound if not found. | * Raise LibBase.NotFound if not found. |
79 | *) | *) |
|
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |