tags:

views:

32

answers:

1

What I want is to have the following source tree layout:

src/  
   a.ml  
   b.ml  
   ...
tests/  
   a.ml  
   b.ml
   ...

Is it possible to distinct these modules and access src/a.ml module as A and tests/a.ml module as something like Tests.A ?

Actually, there also is a problem with ocamlfind (UPD: omake) it thinks that tests/a.ml depends on itself rather than on src/a.ml

Of course, I can just rename the tests as, like, tests/aTest.ml, but I would like to avoid having to do it. And I just don't believe that it's impossible to have any similarly-named files in the whole source tree (regarding distinction purposes -- isn't it what folders and the whole hierarchical file systems thing are for?) Thank you very much!

+3  A: 

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

Actually, there also is a problem with ocamlfind: it thinks that tests/a.ml depends on itself rather than on src/a.ml

ocamlfind doesn't deal with deps between source files. ocaml compiler itself will not be able to resolve module names in such setup.

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

ygrek
oops, I meant omake, not ocamlfind. Thank you, I'll check it out, seems to be exactly what I want.