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 368, Sat Jul 3 13:05:59 1999 UTC revision 369, Sun Jul 4 12:55:20 1999 UTC
# Line 94  Line 94 
94      type ord_key = t      type ord_key = t
95    
96      local      local
         val elabStamp = ref (ref ())  
97          val cwdInfoCache : cwdinfo option ref = ref NONE          val cwdInfoCache : cwdinfo option ref = ref NONE
98          fun cwdInfo () =          fun cwdInfo () =
99              case !cwdInfoCache of              case !cwdInfoCache of
# Line 113  Line 112 
112          val cwdId = #id o cwdInfo          val cwdId = #id o cwdInfo
113      in      in
114          (* start a new era (i.e., invalidate all previous elaborations) *)          (* start a new era (i.e., invalidate all previous elaborations) *)
115          fun newEra () = elabStamp := ref ()          val newEra = Era.newEra
116    
117          (* make sure the cwd is consistent *)          (* make sure the cwd is consistent *)
118          fun revalidateCwd () =          fun revalidateCwd () =
# Line 140  Line 139 
139    
140          fun mkElab (cache, name) = let          fun mkElab (cache, name) = let
141              val e : elaboration =              val e : elaboration =
142                  { stamp = !elabStamp, name = name, id = ref NONE }                  { stamp = Era.thisEra (), name = name, id = ref NONE }
143          in          in
144              cache := SOME e; e              cache := SOME e; e
145          end          end
146    
147          fun validElab NONE = NONE          fun validElab NONE = NONE
148            | validElab (SOME (e as { stamp, name, id })) =            | validElab (SOME (e as { stamp, name, id })) =
149              if stamp = !elabStamp then SOME e else NONE              if Era.isThisEra stamp then SOME e else NONE
150    
151          val rootName = P.toString { isAbs = true, arcs = [], vol = "" }          val rootName = P.toString { isAbs = true, arcs = [], vol = "" }
152          val rootId = ref (NONE: id option)          val rootId = ref (NONE: id option)
# Line 155  Line 154 
154          fun elabContext c =          fun elabContext c =
155              case c of              case c of
156                  THEN_CWD { stamp, name, id } =>                  THEN_CWD { stamp, name, id } =>
157                      { stamp = !elabStamp, id = ref (SOME id),                      { stamp = Era.thisEra (), id = ref (SOME id),
158                        name = if stamp = cwdStamp () orelse name = cwdName ()                        name = if stamp = cwdStamp () orelse name = cwdName ()
159                               then P.currentArc else name }                               then P.currentArc else name }
160                | CONFIG_ANCHOR { fetch, cache, config_name } =>                | CONFIG_ANCHOR { fetch, cache, config_name } =>
# Line 167  Line 166 
166                  in                  in
167                      { name = P.dir name, stamp = stamp, id = ref NONE }                      { name = P.dir name, stamp = stamp, id = ref NONE }
168                  end                  end
169                | ROOT => { stamp = !elabStamp, name = rootName, id = rootId }                | ROOT => { stamp = Era.thisEra (),
170                              name = rootName, id = rootId }
171    
172          and elab (PATH { context, spec, cache }) =          and elab (PATH { context, spec, cache }) =
173              case validElab (!cache) of              case validElab (!cache) of

Legend:
Removed from v.368  
changed lines
  Added in v.369

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