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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 286 - (download) (annotate)
Fri May 21 07:47:16 1999 UTC (21 years, 4 months ago) by blume
File size: 887 byte(s)
skeleton type simplified; improved conversion, etc.
(*
 * The "group registry".  CM uses this to remember which groups it is
 * currently working on, and what the corresponding input sources are.
 *
 * (C) 1999 Lucent Technologies, Bell Laboratories
 *
 * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)
 *)
signature GROUPREG = sig

    type groupreg

    val new : unit -> groupreg
    val register : groupreg -> AbsPath.t * GenericVC.Source.inputSource -> unit
    val lookup : groupreg -> AbsPath.t -> GenericVC.Source.inputSource
    val registered : groupreg -> AbsPath.t -> bool
end

structure GroupReg :> GROUPREG = struct

    type groupreg = GenericVC.Source.inputSource AbsPathMap.map ref

    fun new () = ref AbsPathMap.empty : groupreg

    fun register gr (g, s) = gr := AbsPathMap.insert (!gr, g, s)
    fun lookup gr g = valOf (AbsPathMap.find (!gr, g))
    fun registered gr g = isSome (AbsPathMap.find (!gr, g))
end

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