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/main/autoload.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/main/autoload.sml

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

revision 399, Thu Aug 26 09:55:09 1999 UTC revision 433, Mon Sep 13 06:57:29 1999 UTC
# Line 26  Line 26 
26  end  end
27    
28  functor AutoLoadFn (structure C : COMPILE  functor AutoLoadFn (structure C : COMPILE
29                      structure L : LINK) :> AUTOLOAD = struct                      structure L : LINK
30                        structure BFC : BFC
31                        sharing type C.bfc = L.bfc = BFC.bfc) :> AUTOLOAD = struct
32    
33      structure SE = GenericVC.StaticEnv      structure SE = GenericVC.StaticEnv
34    
# Line 52  Line 54 
54          (* getting rid of unneeded bindings... *)          (* getting rid of unneeded bindings... *)
55          val te' = BE.filterEnv (te, SymbolSet.listItems rss)          val te' = BE.filterEnv (te, SymbolSet.listItems rss)
56          (* make traversal states *)          (* make traversal states *)
57          val { exports = cTrav, ... } = C.newTraversal (L.evict, g)          val { store, get } = BFC.new ()
58          val { exports = lTrav, ... } = L.newTraversal g          val { exports = cTrav, ... } = C.newTraversal (L.evict, store, g)
59            val { exports = lTrav, ... } = L.newTraversal (g, get)
60          fun combine (ss, d) gp =          fun combine (ss, d) gp =
61              case ss gp of              case ss gp of
62                  SOME { stat, sym } =>                  SOME { stat, sym } =>
# Line 88  Line 91 
91                       end)                       end)
92          in          in
93              (* make sure that there are no stale value around... *)              (* make sure that there are no stale value around... *)
94              L.cleanup ();              L.cleanup gp;
95              SymbolMap.foldl one (SOME BE.emptyEnv) m              SymbolMap.foldl one (SOME BE.emptyEnv) m
96          end          end
97    
# Line 105  Line 108 
108          val _ = pending := pend          val _ = pending := pend
109          val (dae, _) = Statenv2DAEnv.cvt ste          val (dae, _) = Statenv2DAEnv.cvt ste
110          val load = ref SymbolMap.empty          val load = ref SymbolMap.empty
111            val announce = let
112                val announced = ref false
113            in
114                fn () =>
115                (if !announced then ()
116                 else (announced := true;
117                       Say.say ["[autoloading]\n"]))
118            end
119          fun lookpend sy = let          fun lookpend sy = let
120              fun otherwise _ = EM.impossible "Autoload:lookpend"              fun otherwise _ = EM.impossible "Autoload:lookpend"
121          in          in
122              case SymbolMap.find (pend, sy) of              case SymbolMap.find (pend, sy) of
123                  SOME (x as ((_, e), _)) =>                  SOME (x as ((_, e), _)) =>
124                      (load := SymbolMap.insert (!load, sy, x);                      (announce ();
125                         load := SymbolMap.insert (!load, sy, x);
126                       BuildDepend.look otherwise e sy)                       BuildDepend.look otherwise e sy)
127                | NONE => DAEnv.EMPTY                | NONE => DAEnv.EMPTY
128          end          end
# Line 153  Line 165 
165      in      in
166          if SymbolMap.isEmpty loadmap then ()          if SymbolMap.isEmpty loadmap then ()
167          else          else
168              (Say.say ["[autoloading]\n"];              (SrcPath.revalidateCwd ();
              SrcPath.revalidateCwd ();  
169               (* We temporarily turn verbosity off, so we need to wrap this               (* We temporarily turn verbosity off, so we need to wrap this
170                * with a SafeIO.perform... *)                * with a SafeIO.perform... *)
171               SafeIO.perform               SafeIO.perform
172                { openIt = fn () =>                { openIt = fn () => #get StdConfig.verbose () before
173                    EnvConfig.getSet StdConfig.verbose (SOME false),                                    #set StdConfig.verbose false,
174                  closeIt = ignore o (EnvConfig.getSet StdConfig.verbose) o SOME,                  closeIt = ignore o #set StdConfig.verbose,
175                  cleanup = fn () => (),                  cleanup = fn () => (),
176                  work = fn _ =>                  work = fn _ =>
177                    (case loadit loadmap of                    (case loadit loadmap of

Legend:
Removed from v.399  
changed lines
  Added in v.433

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