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/paths/abspath.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/paths/abspath.sml

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

revision 366, Fri Jul 2 14:13:29 1999 UTC revision 367, Sat Jul 3 04:59:01 1999 UTC
# Line 7  Line 7 
7   *)   *)
8  signature ABSPATH = sig  signature ABSPATH = sig
9    
10        exception Format        (* if something is seriously wrong with a pickle *)
11        exception BadAnchor of string       (* if anchor cannot be resolved *)
12    
13      type context      type context
14      type t      type t
15      type ord_key = t      type ord_key = t
# Line 34  Line 37 
37      (* the second path argument is the path of the group spec that      (* the second path argument is the path of the group spec that
38       * pickling is based upon. *)       * pickling is based upon. *)
39      val pickle : (bool -> unit) -> t * t -> string list      val pickle : (bool -> unit) -> t * t -> string list
40      val unpickle : PathConfig.mode -> string list * t -> t option      val unpickle : PathConfig.mode -> string list * t -> t
41    
42      val tstamp : t -> TStamp.t      val tstamp : t -> TStamp.t
43  end  end
# Line 45  Line 48 
48      structure F = OS.FileSys      structure F = OS.FileSys
49      val impossible = GenericVC.ErrorMsg.impossible      val impossible = GenericVC.ErrorMsg.impossible
50    
51        exception Format
52        exception BadAnchor of string
53    
54      (* unique file id that can handle absent files *)      (* unique file id that can handle absent files *)
55      datatype id =      datatype id =
56          PRESENT of F.file_id          PRESENT of F.file_id
# Line 256  Line 262 
262    
263          fun unpickle mode (l, gpath) = let          fun unpickle mode (l, gpath) = let
264              fun u_p (s :: l) =              fun u_p (s :: l) =
265                  Option.map                  PATH { spec = s, context = u_c l, cache = ref NONE }
266                     (fn c => PATH { spec = s, context = c, cache = ref NONE })                | u_p [] = raise Format
267                  (u_c l)              and u_c ["r"] = ROOT
268                | u_p [] = NONE                | u_c ["c"] = DIR_OF gpath
             and u_c ["r"] = SOME ROOT  
               | u_c ["c"] = SOME (DIR_OF gpath)  
269                | u_c [n, "a"] =                | u_c [n, "a"] =
270                  (case PathConfig.configAnchor mode n of                  (case PathConfig.configAnchor mode n of
271                       NONE => NONE                       NONE => raise BadAnchor n
272                     | SOME fetch =>                     | SOME fetch =>
273                           SOME (CONFIG_ANCHOR { config_name = n,                           CONFIG_ANCHOR { config_name = n,
274                                                 fetch = fetch,                                                 fetch = fetch,
275                                                 cache = ref NONE }))                                           cache = ref NONE })
276                | u_c l = Option.map DIR_OF (u_p l)                | u_c l = DIR_OF (u_p l)
277          in          in
278              u_p l              u_p l
279          end          end

Legend:
Removed from v.366  
changed lines
  Added in v.367

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