Re: recursive imporged variable declarations

Dear Per,

No, there is no constraint that prohibits the anomalous
cyclic variable definitions in mutually dependent
modules that you give below.

Ihe next draft of the Formal Semantics, which will
provide a formal definition of module import, we basically
warn the implementor that s/he must detect cyclic definitions.

I hope that helps,
Mary

> -----Original Message-----
> From: public-qt-comments-request@w3.org
> [mailto:public-qt-comments-request@w3.org] On Behalf Of Per Bothner
> Sent: November 13, 2003 10:56 PM
> To: public-qt-comments@w3.org
> Subject: recursive imporged variable declarations
> 
> 
> Section 4.8 "Variable Declaration" of the XQuery November specification
> says that:
>    A variable may appear in the expression part of a variable
> declaration
>    only if that variable is declared or imported earlier in the Prolog
>    than the declaration in which it is used.
> This is presumably to prevent indeterminacies and cycles.
> However, section 4.7 "Module Import" says that:
>    Two modules may import each other.
> 
> So is there anything to prohibit the following?
> 
> module namespace m1 = "M1";
> import module namespace m2 = "M2";
> declare variable $m1:v { $m2:v };
> 
> module namespace m2 = "M2";
> import module namespace m1 = "M1";
> declare variable $m2:v { $m1:v }
> -- 
> 	--Per Bothner
> per@bothner.com   http://per.bothner.com/
> 
-- 
Mary Fernandez, Principal Technical Staff Member
AT&T Labs - Research, 180 Park Ave., Room E277, Florham Park, NJ 07932-0971
phone: 973-360-8679,  fax: 973-360-8187
mff@research.att.com, http://www.research.att.com/~mff

Received on Friday, 28 November 2003 18:24:08 UTC