D.J.Peters wrote:A namespace is primary to group things to gether or sepperate things from global module (name)space.
mynamespace.mygroup.mything = 1
looks like you mean something this:
mything = 1
No, I really mean the possibility for identifiers to be used cross-module explicitely with or without their namespace prefix, and even to keep identifiers private, meaning they cannot be used cross-module, something like this:
Code: Select all
' cannot be used cross module (implicit)
[private] dim HideMe as integer = 1
[private] dim HideMeToo as integer = 2
' can be used cross module but only with module prefix (explicit)
protected const MyName = "module1"
' can be used everywhere without module prefix (explicit)
declare public function ShowMe() as integer
public function ShowMe() as integer
return HideMe + HideMeToo
This way a namespace would be very much like an object, but without instantiation, constructors etc. There would also be no need to 'dim share' or 'extern' an identifier to give it global scope.