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 /sml/trunk/src/smlnj-lib/Util/int-list-map.sml
ViewVC logotype

Diff of /sml/trunk/src/smlnj-lib/Util/int-list-map.sml

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

revision 29, Thu Mar 12 01:05:59 1998 UTC revision 289, Sat May 22 21:01:25 1999 UTC
# Line 19  Line 19 
19    
20      val empty = []      val empty = []
21    
22        fun isEmpty [] = true
23          | isEmpty _ = false
24    
25      (* return the first item in the map (or NONE if it is empty) *)
26        fun first [] = NONE
27          | first ((_, value)::_) = SOME value
28    
29      (* return the first item in the map and its key (or NONE if it is empty) *)
30        fun firsti [] = NONE
31          | firsti ((key, value)::_) = SOME(key, value)
32    
33      fun insert (l, key, item) = let      fun insert (l, key, item) = let
34            fun f [] = [(key, item)]            fun f [] = [(key, item)]
35              | f ((elem as (key', _))::r) = (case Key.compare(key, key')              | f ((elem as (key', _))::r) = (case Key.compare(key, key')

Legend:
Removed from v.29  
changed lines
  Added in v.289

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