Using Poly/ML to build projects with nested directory structures -
until now, have been using poly/ml several small projects source code files in same directory. build these projects, had run following command in repl:
> polyml.make "main";
but have project scale makes impractical put source code files in same directory. build these projects in repl, need run following commands:
> polyml.make "foo/foo"; > polyml.make "bar/bar"; > polyml.make "qux/qux"; > polyml.make "main";
which not terribly practical number of subsystems grows.
is there way automate process of building projects nested directory structures in poly/ml?
p.d.: have had @ both sml/nj's compilation manager , mlton's ml basis system. while unquestionably powerful, these complicated needs.
put file called ml_bind.ml in each of sub-directories , have files build component directory.
polyml.make expects name of source file match name of component (structure, signature or functor). if looking structure called "foo" expect source "foo" in file called "foo", "foo.ml" or "foo.sml". if instead finds directory called "foo" recursively enters "foo" directory , uses "ml_bind.ml" file guide build "foo" structure. typically, "foo/ml_bind.ml" like
structure foo = foofunctor(structure = fooa , b = foob);
with files "foo/foofunctor.ml", "foo/fooa.ml" , "foo/foob.ml" containing source "foofunctor", "fooa" , "foob" respectively.
you can find examples of in code poly/ml compiler comes part of poly/ml source code distribution.
Comments
Post a Comment