[Bug 5413] [XQuery] C.2: "scope" of 'function implementations' component

------- Comment #2 from jmdyck@ibiblio.org  2008-04-02 02:33 -------
(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.

Received on Friday, 4 April 2008 09:59:09 UTC