This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 5413 - [XQuery] C.2: "scope" of 'function implementations' component
Summary: [XQuery] C.2: "scope" of 'function implementations' component
Status: CLOSED WONTFIX
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 1.0 (show other bugs)
Version: Recommendation
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Don Chamberlin
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-24 01:56 UTC by Michael Dyck
Modified: 2008-04-16 00:33 UTC (History)
0 users

See Also:


Attachments

Description Michael Dyck 2008-01-24 01:56:02 UTC
C.2 Dynamic Context Components

On the row for the "Function implementations" component, the Scope is given as "global". This should be "module".

Note that that component is required to be consistent with the function signatures component of the static context, whose Scope is given as "module".
Comment 1 Michael Kay 2008-03-18 11:00:59 UTC
There are only two values defined for the "scope" of a component in the dynamic context: "global" and "dynamic". They are defined like this:

Scope: Indicates where the component is applicable. "Global" indicates that the component applies globally, throughout all the modules used in a query, and remains constant during evaluation of a query. "Dynamic" indicates that evalation of an expression may influence the value of the component for that expression and for nested expressions.

The function implementations component is constant during the evaluation of a query, so I think that under these definitions it is global.

But "Fixed" would be a better term.

Actually, I see very little point in modelling "function implementations" as part of the dynamic context. In fact, I think it's positively misleading: I think most processors are likely to take advantage of the fact that function implementations are known at compile time, or at the very latest at link time.
Comment 2 Michael Dyck 2008-04-02 02:33:02 UTC
(In reply to comment #1)
> There are only two values defined for the "scope" of a component in the
> dynamic context: "global" and "dynamic".

Hm, so it is. (However, note that according to 2.1.2, the dynamic context
contains all the components of the static context, so it's somewhat unclear
what happens to those components when they have "module" or "lexical" scope.)

> They are defined like this:
> 
> Scope: Indicates where the component is applicable. "Global" indicates that
> the component applies globally, throughout all the modules used in a query,
> and remains constant during evaluation of a query.

I find this definition unsatisfying.  The wording, in which a context
component "applies" (or "is applicable") somewhere, isn't really explained.
(As far as I can tell, it isn't used anywhere else in the spec.)

(Moreover, in language specs, "scope" usually has to do with the visibility of
declared identifiers (e.g., "in-scope variables"), which isn't the case here.)

> "Dynamic" indicates that evalation of an expression may influence the
> value of the component for that expression and for nested expressions.

(Just noticed the typo: "evalation" for "evaluation".)

> The function implementations component is constant during the evaluation of
> a query, so I think that under these definitions it is global.
> 
> But "Fixed" would be a better term.

That might convey the intent better, except that putting it under the heading
of "Scope" (suggesting "fixed scope" or "scope is fixed") would probably give
the wrong impression.

> Actually, I see very little point in modelling "function implementations" as
> part of the dynamic context. In fact, I think it's positively misleading: I
> think most processors are likely to take advantage of the fact that function
> implementations are known at compile time, or at the very latest at link
> time.

I'm inclined to agree. I don't think moving "function implementations" to the
static context would have any ill effects.
Comment 3 Don Chamberlin 2008-04-15 21:33:08 UTC
Michael,
The Query Working Group considered this bug report on 15 April 2008. The working group agrees that "fixed" or "static" would be a more descriptive term for the scope of a function implementation than the current term "global." However, the consensus of the working group was that this issue does not rise to the level of an error that needs to be corrected by publishing an erratum at this time. 

In a future version of the XQuery specification, we will consider revising the scope categories for dynamic context components.

If you are satisfied with this resolution, please mark this bug report as Closed.
Regards,
Don Chamberlin (for the query working group)