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/cm/semant/group-reg.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/semant/group-reg.sml

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

revision 281, Tue May 18 14:57:00 1999 UTC revision 294, Tue May 25 09:06:06 1999 UTC
# Line 1  Line 1 
1    (*
2     * The "group registry".  CM uses this to remember which groups it is
3     * currently working on and what the corresponding input sources are.
4     *
5     * (C) 1999 Lucent Technologies, Bell Laboratories
6     *
7     * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)
8     *)
9  signature GROUPREG = sig  signature GROUPREG = sig
10      val clear : unit -> unit  
11      val register : AbsPath.t * GenericVC.Source.inputSource -> unit      type groupreg
12      val lookup : AbsPath.t -> GenericVC.Source.inputSource  
13      val registered : AbsPath.t -> bool      val new : unit -> groupreg
14        val register : groupreg -> AbsPath.t * GenericVC.Source.inputSource -> unit
15        val lookup : groupreg -> AbsPath.t -> GenericVC.Source.inputSource
16        val registered : groupreg -> AbsPath.t -> bool
17  end  end
18    
19  structure GroupReg :> GROUPREG = struct  structure GroupReg :> GROUPREG = struct
20    
21      val m  =      type groupreg = GenericVC.Source.inputSource AbsPathMap.map ref
22          ref (AbsPathMap.empty: GenericVC.Source.inputSource AbsPathMap.map)  
23        fun new () = ref AbsPathMap.empty : groupreg
24    
25      fun clear () = m := AbsPathMap.empty      fun register gr (p, s) = gr := AbsPathMap.insert (!gr, p, s)
26      fun register (g, s) = m := AbsPathMap.insert (!m, g, s)      fun lookup gr p = valOf (AbsPathMap.find (!gr, p))
27      fun lookup g = valOf (AbsPathMap.find (!m, g))      fun registered gr g = isSome (AbsPathMap.find (!gr, g))
     fun registered g = isSome (AbsPathMap.find (!m, g))  
28  end  end

Legend:
Removed from v.281  
changed lines
  Added in v.294

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