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/Semant/basics/env.sml
ViewVC logotype

Diff of /sml/trunk/src/compiler/Semant/basics/env.sml

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

revision 113, Fri Jun 5 19:41:21 1998 UTC revision 132, Mon Sep 7 19:48:36 1998 UTC
# Line 4  Line 4 
4  signature INTSTRMAPV =  signature INTSTRMAPV =
5  sig  sig
6    type 'a intstrmap    type 'a intstrmap
7    val new : (int * string * '_a) list -> '_a intstrmap    val new : (int * string * 'a) list -> 'a intstrmap
8    
9    (* in case of duplicates, the element towards the head of the    (* in case of duplicates, the element towards the head of the
10     * list is discarded,and the one towards the tail is kept.     * list is discarded,and the one towards the tail is kept.
# Line 199  Line 199 
199       in g(0,zero)       in g(0,zero)
200      end      end
201    
202    fun new (bindings: (int*string*'_b) list) =    fun new (bindings: (int*string*'b) list) =
203      let val n = List.length bindings      let val n = List.length bindings
204          val a0 = Array.array(n,NIL: '_b bucket)          val a0 = Array.array(n,NIL: 'b bucket)
205          val dups = ref 0          val dups = ref 0
206    
207          fun add a (i,s,b) =          fun add a (i,s,b) =
# Line 217  Line 217 
217          val _ = List.app (add a0) bindings          val _ = List.app (add a0) bindings
218          val a1 = case !dups          val a1 = case !dups
219                    of 0 => a0                    of 0 => a0
220                     | d => let val a = Array.array(n-d, NIL: '_b bucket)                     | d => let val a = Array.array(n-d, NIL: 'b bucket)
221                             in List.app (add a) bindings; a                             in List.app (add a) bindings; a
222                            end                            end
223    

Legend:
Removed from v.113  
changed lines
  Added in v.132

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