[MLton] cvs commit: world no longer contains a preprocessed
basis library
Stephen Weeks
MLton@mlton.org
Mon, 15 Dec 2003 12:38:54 -0800
> I think you'll need to expain your filter idea better. Maybe it does
> work, given that one is only ever working with one list of files at a
> time.
I think the only point of confusion is that I would like the
dependence information per SML file, while CM is giving it per CM
file. My filter idea is that we have (from CM or mlb dependence
analysis) a map
depends: SMLFile -> P(SMLFile)
This map tells us, for each file f, the files that define the modules
that f imports. So, for the example in question
sources.cm: Group
structure Main
in
AB/sources.cm
main.sml (* uses structure A *)
AB/sources.cm: Group
structure A
structure B
in
XYZ/sources.cm
AB/a.sml (* uses structure X *)
AB/b.sml (* uses structure Y *)
XYZ/sources.cm: Group
structure X
structure Y
structure Z
in
XYZ/x.sml
XYZ/y.sml
XYZ/z.sml
The map is
f depends(f)
--------- ---------------
main.sml {AB/a.sml}
AB/a.sml {XYZ/x.sml}
AB/b.sml {XYZ/y.sml}
XYZ/x.sml {}
XYZ/y.sml {}
XYZ/z.sml {}
Then, it is a simple matter to use depends to produce the set of
needed files for main.sml. The topological order is easy too.
My current understanding is that depends is not extractable from what
CM gives you.