namespaces
namespaces copied to clipboard
Ignore paths tagged with -traverse while scanning
Minor point: Currently, Modules.scan_tree inspects all of the current directory and subdirectories, including my .git and my huge benchmark directory. Both are normally ignored by ocamlbuild because I put -traverse, not_hygienic tags. Namespaces happily goes there anyway. Might be worth looking up for the traverse tag before going in. Namespaces.delete_mllib_files should probably take that into account to.
This is a good idea.
About the status of this project: Namespaces currently doesn't work well enough in somewhat complex situations. My original plan was to basically write a new ocamldep
that does what Namespaces needs; in fact, Octachron ended up writing it independently: codept. I had only made some tests in the 4.03-ocamldep
branch, trying to avoid going down this path unless necessary.
Until Namespaces is ported to codept, I can't honestly recommend using it at all. I've added a warning to the README
about this.
If you want to make a PR anyway, however, I can merge it.
Thanks for the news about this project. It's a great project and hopefully someone will find the time to port it to codept! Until then, I'm still interested in using it, since my previous solution with mlpacks in every directory is getting really tiresome. And trying to automate this with oasis is not good, since I have to write one section in my _oasis file for each subdirectory for which I want a namespace.
Last thing I'd like to propose: All of your examples have <**/*>: include, which essentially flattens the directory structure. I'd still like to limit the visibility of directories: for instance in other parts of my code where I'm not using namespaces, it would bother me to include everything. So I'd like a tag "include_all" so that, underneath a path src/path1 tagged with "include_all", all directories are visible to each other (typically when I use namespaces on src/path1), but I don't flatten src/path2. I have implemented that "include_all" tag using Pathname.define_context in your modules.ml. It does not affect anything if the include_all tag is not used. Can I do a PR? or do you see another way to address my issue?