<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>1848</bug_id>
          
          <creation_ts>2005-08-16 10:15:16 +0000</creation_ts>
          <short_desc>[XQuery] Module Imports</short_desc>
          <delta_ts>2005-08-31 22:41:07 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XQuery 1.0</component>
          <version>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="Don Chamberlin">chamberl</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>5409</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2005-08-16 10:15:17 +0000</bug_when>
    <thetext>This is a minor technical point which can probably be handled editorially.

We allow a module to do an &quot;import module&quot; on its own namespace.

We say that the effect of this is to import all modules for that namespace. This
includes the importing module.

We say that it&apos;s an error if the imported module contains functions or variables
that clash with those defined in the importing module. But when a module imports
itself, there will always be such a clash.

Solution: we should specify that when a module does an &quot;import module&quot; on its
own namespace, it should import all modules for that namespace *other than itself*.

(We have a bit of a problem with module identity: how do we know whether two
URIs identify the same module? But I suggest we leave implementations to sort
that one out.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5411</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2005-08-16 18:01:38 +0000</bug_when>
    <thetext>While on the topic, it would be useful to clarify whether a module that imports
its own namespace is allowed to contain forwards references to its own global
variables. You can read the spec either way on this: on the one hand it says
forwards references to global variables aren&apos;t allowed; on the other hand it
says you can access all the global variables declared in a namespace that you&apos;ve
imported.

It&apos;s a little odd if it isn&apos;t allowed: if cyclic references to variables are
allowed across modules, why not allow them within a module? It&apos;s also difficult
to explain (and implement!) that a module has access to all the global variables
in an imported namespace except those that are declared in the same module and
after the variable reference.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5624</commentid>
    <comment_count>2</comment_count>
    <who name="Don Chamberlin">chamberl</who>
    <bug_when>2005-08-31 21:48:48 +0000</bug_when>
    <thetext>The original bug report, about a module importing its own namespace, was 
accepted by the Query working group on 31 Aug 2005, and the proposed change has 
been implemented. I will mark this bug as &quot;fixed&quot;.

The working group felt that the additional comment about forward references to 
global variables required further discussion. Mike, it is suggested that you 
open a separate bug report for this issue.

--Don Chamberlin</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5629</commentid>
    <comment_count>3</comment_count>
    <who name="Don Chamberlin">chamberl</who>
    <bug_when>2005-08-31 22:41:07 +0000</bug_when>
    <thetext>(Done. The new bug report is number 1928.)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>