jassing wrote:
Would be nice to have a "DeclareExternal" to indicate the procedure is outside the module.
I believe all could be more simply fixed by just adding the possibility to access the implicitly defined "global module" by using the "::" qualifier like other languages do.
There is no need to invent something new, the problem has already been solved.
So inside your module you would write MyModule::MyFunc() or MyFunc() to call a function in the module scope and ::MyFunc() to call a function defined in the global scope.
Same thing for constants: #MYCONST and ::#MYCONST
But the developers said no to this.
Constants defined in residents already break the module barrier BTW.
PB modules are a strangely limited beast in my opinion, it's too bad they were not fixed/extended when they were introduced and some people commented about these shortcomings because I was very happy about the idea of a namespace-like model when initially announced.
I don't think they are gonna change it now (but I would love to be wrong).