Module imports are not transitive?
Hi,
"Module imports are not transitive—that is, importing a module provides access only to function and variable declarations contained directly in the imported module. For example, if module A imports module B, and module B imports module C, module A does not have access to the functions and variables declared in module C." https://www.w3.org/TR/xquery-30/#id-module-import
I have noticed before that BaseX does not appear to implement this see [1] My case was a conflict in a module that was imported internally within an EXpath Package and the same namespace used as a module in an application. I have just seen another example today where the current behavior was regarded as a "good" feature.
I don't remember ever seeing any discussion on this. Is this something that might be implemented at some point? /Andy
[1] https://gist.github.com/apb2006/9702104456e5ee2c48f4ff4f9eba5c1b#file-main-xq
Hi Andy,
An interesting finding! I didn’t notice this so far, and it seems no one else did. I have added an issue to track this down [1].
Thanks, Christian
Quoted text · Andy Bunce · 16 lines
On Wed, Nov 24, 2021 at 7:08 PM Andy Bunce <bunce.andy at gmail.com> wrote: > > Hi, > > "Module imports are not transitive—that is, importing a module provides access only to function and variable declarations contained directly in the imported module. For example, if module A imports module B, and module B imports module C, module A does not have access to the functions and variables declared in module C." https://www.w3.org/TR/xquery-30/#id-module-import > > I have noticed before that BaseX does not appear to implement this see [1] My case was a conflict in a module that was imported internally within an EXpath Package and the same namespace used as a module in an application. I have just seen another example today where the current behavior was regarded as a "good" feature. > > I don't remember ever seeing any discussion on this. Is this something that might be implemented at some point? > /Andy > > [1] https://gist.github.com/apb2006/9702104456e5ee2c48f4ff4f9eba5c1b#file-main-xq > > > >
Written for BaseX 9.6. BaseX may have changed since: please check the current documentation.