W3C home > Mailing lists > Public > public-qt-comments@w3.org > April 2007

[Bug 4418] [XQuery] cyclic module imports

From: <bugzilla@wiggum.w3.org>
Date: Tue, 03 Apr 2007 21:51:06 +0000
CC:
To: public-qt-comments@w3.org
Message-Id: <E1HYquA-0000Tc-G5@wiggum.w3.org>

http://www.w3.org/Bugs/Public/show_bug.cgi?id=4418





------- Comment #1 from mike@saxonica.com  2007-04-03 21:51 -------
I was asked by the WGs (Action A-326-06) to draft a concrete proposal that
would ban all cyclical imports.

In doing this I wondered how to deal with the sentence "Each module import
names a target namespace and imports an implementation-defined set of modules
that share this target namespace." The effect of this sentence is that a module
can be imported (and can cause cyclicity) without the user actually knowing or
intending it. It seems best therefore not to ban cyclical imports, but to ban
cyclical dependencies: a dependency is entirely under user control, whereas an
import is not. My proposal is therefore as follows:

(a) This paragraph is retained unchanged:

[Definition: A module M1 directly depends on another module M2 (different from
M1) if a variable or function declared in M1 depends on a variable or function
declared in M2.] It is a static error [err:XQST0093] to import a module M1 if
there exists a sequence of modules M1 ... Mi ... M1 such that each module
directly depends on the next module in the sequence (informally, if M1 depends
on itself through some chain of module dependencies.)

(b) This sentence is deleted, along with error XQST0073:

However, it is a static error [err:XQST0073] if the graph of module imports
contains a cycle (that is, if there exists a sequence of modules M1 ... Mn such
that each Mi imports Mi+1 and Mn imports M1), unless all the modules in the
cycle share a common namespace.

The effect of this change is that cyclic imports are banned after discounting
any pointless imports, a pointless import being one where A imports B but does
not reference any variables or functions declared in B.

The current spec has the effect that a cycle of imports is permitted only if
(a) all the modules share the same namespace, and (b) at least one of the
imports is pointless. The revised spec has the effect that a cycle of imports
is permitted provided that at least one of the imports is pointless. 
Received on Tuesday, 3 April 2007 21:51:15 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:33 UTC