Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /smlnj-lib/branches/rt-transition/Util/splay-map-fn.sml
ViewVC logotype

Diff of /smlnj-lib/branches/rt-transition/Util/splay-map-fn.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2144, Thu Nov 2 16:23:11 2006 UTC revision 2274, Tue Jan 30 15:00:09 2007 UTC
# Line 82  Line 82 
82      fun find (EMPTY,_) = NONE      fun find (EMPTY,_) = NONE
83        | find (MAP{root,nobj},key) = (case splay (cmpf key, !root)        | find (MAP{root,nobj},key) = (case splay (cmpf key, !root)
84             of (EQUAL, r as SplayObj{value,...}) => (root := r; SOME(#2 value))             of (EQUAL, r as SplayObj{value,...}) => (root := r; SOME(#2 value))
85              | (_, r) => (root := r; NONE))              | (_, r) => (root := r; NONE)
86              (* end case *))
87    
88      (* Look for an item, raise NotFound if the item doesn't exist *)
89        fun lookup (EMPTY,_) = raise LibBase.NotFound
90          | lookup (MAP{root,nobj},key) = (case splay (cmpf key, !root)
91               of (EQUAL, r as SplayObj{value,...}) => (root := r; #2 value)
92                | (_, r) => (root := r; raise LibBase.NotFound)
93              (* end case *))
94    
95          (* Remove an item.          (* Remove an item.
96           * Raise LibBase.NotFound if not found           * Raise LibBase.NotFound if not found

Legend:
Removed from v.2144  
changed lines
  Added in v.2274

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0