[MLton] MLB path variables (was: mlnlffigen is awesome)
Vesa Karvonen
vesa.karvonen@cs.helsinki.fi
Mon, 22 Aug 2005 18:36:36 +0300
Quoting Stephen Weeks <sweeks@sweeks.com>:
> > What I had in mind is that path variables would work just like other
> > bindings; Path variable bindings imported from a basis would only
> > effect paths in the scope of the import.
>
> This makes sense. It still seems a little tricky to get at SML_LIB
> and other things that are not part of the current project, and may be
> in different places on different machines. Would one have a Makefile
> that generates the appropriate MLB that defines SML_LIB, and then
> import that into every MLB that refers to SML_LIB?
That would be one possibility. However, there should not be (significantly)
more need to generate MLB files (with var-extension) than there should be
need to generate MLB path map files when they are project specific.
> Or would there
> still be some special variables that are in the primitive basis that
> MLBs are elaborated in? At which point I'm wondering if this proposal
> is complementary to the current MLB path variables rather than a
> replacement. Namely, your proposal gives one a way to name path
> variables for use within a project, while the current MLB path
> variables are for referring to other projects by a portable name.
Well, to be honest, I don't know whether either scheme is generally
preferable over the other. Using MLB+vars one should be able to get
an organization of files similar to MLB+MLB-path-maps by using
the "local ../config.mlb ... in ... end" idiom. Whether or not the
additional features provided by MLB+vars (local path variables and
the ability to import path variables) are useful enough to warrant
the extra complexity is not clear to me.
-Vesa Karvonen