Fred wrote:Your code is invalid as it miss the Module:EndModule part for both modules. It has been fixed for the next beta.
Hello Fred, and thanks for your reply. However, I think that you've missed my point. The sample works, and with or without the Module/EndModule sections, the question was relating to the namespace.
How does module
B recognise the declaration of module
A? Module
A has only been declared in the global namespace and not inside module
B? I thought that modules, especially their public components, would only be recognised and usable if they are declared inside the namespace where they are to be used?
Code: Select all
DeclareModule A ;module A declared in the global namespace
x = 123
EndDeclareModule
Module A
EndModule
Debug A::x ;module A recognised in global namespace - CORRECT
DeclareModule B ;module A not declared in module B's namespace
x = A::x ;so, how is module A recognised in module B?
EndDeclareModule
Module B
EndModule
Debug B::x ;and it works too!
It seems to be inheriting the declaration from the global namespace, which according to you, is not allowed.
Thank you for your attention.
