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/compiler/FLINT/kernel/ltykernel.sml
ViewVC logotype

Diff of /sml/trunk/src/compiler/FLINT/kernel/ltykernel.sml

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

revision 732, Mon Nov 13 21:59:12 2000 UTC revision 733, Fri Nov 17 05:13:45 2000 UTC
# Line 11  Line 11 
11   ***************************************************************************)   ***************************************************************************)
12    
13  (** hashconsing implementation basics *)  (** hashconsing implementation basics *)
14  local open SortedList  local (* open SortedList *)
15        val MVAL = 10000        val MVAL = 10000
16        val BVAL = MVAL * 2 (* all index i start from 0 *)        val BVAL = MVAL * 2 (* all index i start from 0 *)
17  in  in
# Line 42  Line 42 
42              * tvar list                 (* free named type vars *)              * tvar list                 (* free named type vars *)
43    | AX_NO                               (* no aux_info available *)    | AX_NO                               (* no aux_info available *)
44    
45  val mergeTvs = merge  (* these two are originally from SortedList -- which I wanted to get
46  val fmergeTvs = foldmerge   * rid off.  -- Matthias  11/2000 *)
47    fun mergeTvs (l, []) = l
48      | mergeTvs ([], l) = l
49      | mergeTvs (l as (h :: t), l' as (h' :: t')) =
50        if h < h' then h :: mergeTvs (t, l')
51        else if h = h' then h :: mergeTvs (t, t')
52        else h' :: mergeTvs (l, t')
53    
54    fun fmergeTvs [] = []
55      | fmergeTvs (h :: t) = let
56            fun loop ([], a) = a
57              | loop (h :: t, a) = loop (t, mergeTvs (h, a))
58        in
59            loop (t, h)
60        end
61    
62    (*
63    val mergeTvs = SortedList.merge
64    val fmergeTvs = SortedList.foldmerge
65    *)
66    
67  type 'a hash_cell = (int * 'a * aux_info) ref  type 'a hash_cell = (int * 'a * aux_info) ref
68    

Legend:
Removed from v.732  
changed lines
  Added in v.733

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