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

SCM Repository

[smlnj] Annotation of /sml/trunk/src/cm/semant/group-reg.sml
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 286 - (view) (download)

1 : blume 286 (*
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 : blume 281 signature GROUPREG = sig
10 : blume 286
11 :     type groupreg
12 :    
13 :     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 : blume 281 end
18 :    
19 :     structure GroupReg :> GROUPREG = struct
20 :    
21 : blume 286 type groupreg = GenericVC.Source.inputSource AbsPathMap.map ref
22 : blume 281
23 : blume 286 fun new () = ref AbsPathMap.empty : groupreg
24 :    
25 :     fun register gr (g, s) = gr := AbsPathMap.insert (!gr, g, s)
26 :     fun lookup gr g = valOf (AbsPathMap.find (!gr, g))
27 :     fun registered gr g = isSome (AbsPathMap.find (!gr, g))
28 : blume 281 end

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