2011年1月28日星期五

ocaml modules with the same (file)name in different folders

In ocaml, if you have files with the same name in different folders, like this

src1/
a.ml
b.ml
...
src2/
a.ml
b.ml
...

You should need -pack option:

-pack option can be used to group the set of compiled objects under the single module name.


You can do

ocaml -p -o src1.cmo src1/a.cmo src1/b.cmo
ocaml -p -o src2.cmo src2/a.cmo src2/b.cmo


In you file, you will need call Src1.A.xxx or Src2.B.xxx ...

Notes, it is better to avoid similarily named files in source tree :)

没有评论:

发表评论