“I also like cimport being in the global namespace. I realise that you don’t like polluting the global namespace, but there’s a point at which that principle crosses the boundary and just starts making everything complicated.”
Ah, my reasoning for this wasn’t because I was concerned about polluting the global namespace in this case, it’s because I don’t like th fact that there are units of code with the same name that behave slightly differently depending on where they are used, which is confusing. Since cmodule.import is really only necessary from the Main tab, I don’t this this would actually be too cumbersome, but of you disagree with this point then I’ll consider leaving _G.cimport/cload.
“but a module can get round this by using the __pathto or __proj. If I ever use these (which at the moment I doubt I will) then I’d probably rename them to something a bit more friendly.”
I’d also rethink renaming these if you do use them. I tried to choose names that were obvious, but were unlikely to clash with variables used by the end programmer. Again, commonly, I suspect that these won’t be used often, and I think they should stand out. Additionally, if you use a modified version of cmodule, the code you write with it will not be compatible with the stock cmodule, which makes it difficult to share your code with others, which sort of defeats one of the main benefits of using a module system. I am all ears though on suggestions for more friendly names, as long as they are names that are unlikely to be used by end programmers.
Which brings me to my last point: if I were to add the search path functionality in the way I specced out above, would you use the stock version of cmodule in that case? I’d really like to avoid having alternate versions floating around, because it will make it hard for me to provide support when I can’t trust that everybody is using the same code.
EDIT: also, I still see calls in your example that look like:
cimport "Library CModule:Colour"
Does this still work? What does it do? Is it still necessary?