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/stable/stabilize.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/stable/stabilize.sml

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

revision 732, Mon Nov 13 21:59:12 2000 UTC revision 733, Fri Nov 17 05:13:45 2000 UTC
# Line 117  Line 117 
117          fun oneB i (sy, (nth, _, _), m) =          fun oneB i (sy, (nth, _, _), m) =
118              case nth () of              case nth () of
119                  (_, DG.SB_BNODE (DG.BNODE n, _)) =>                  (_, DG.SB_BNODE (DG.BNODE n, _)) =>
120                    (* we blindly override existing info for the same bnode;
121                     * this means that the last guy wins... *)
122                  StableMap.insert (m, #bininfo n, (i, sy))                  StableMap.insert (m, #bininfo n, (i, sy))
123                | _ => m                | _ => m
124            (* ... but we want the first guy to win, so we do foldr
125             * and count from the top. *)
126          fun oneSL (g as GG.GROUP { exports, ... }, (m, i)) =          fun oneSL (g as GG.GROUP { exports, ... }, (m, i)) =
127              (SymbolMap.foldli (oneB i) m exports, i + 1)              (SymbolMap.foldli (oneB i) m exports, i - 1)
128            | oneSL (_, (m, i)) = (m, i + 1)            | oneSL (_, (m, i)) = (m, i - 1)
129          fun oneSL' ((_, gth, _), a) = oneSL (gth (), a)          fun oneSL' ((_, gth, _), a) = oneSL (gth (), a)
130          val (im, _) = foldl oneSL' (StableMap.empty, 0) sublibs          val (im, _) =
131                foldr oneSL' (StableMap.empty, length sublibs - 1) sublibs
132          fun look i =          fun look i =
133              case StableMap.find (im, i) of              case StableMap.find (im, i) of
134                  SOME p => p                  SOME p => p

Legend:
Removed from v.732  
changed lines
  Added in v.733

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