[Bug 29277] [XP31] Evaluating function calls does not mention evaluation of dynamic or static function calls that have no FunctionBody


--- Comment #15 from Abel Braaksma <abel.braaksma@xs4all.nl> ---
(In reply to Michael Kay from comment #14)
> I would personally prefer to base this on the "context-dependent" property
> defined in F+O:
> [Definition] A function may have the property of being context-dependent:
> the result of such a function depends on the values of properties in the
> static and dynamic evaluation context as well as on the actual supplied
> arguments (if any).
This makes sense to me. Note that this deviates quite strongly from the current
definition (which only takes care of FunctionBody-functions and the rest, as
comment 13 and bottom of comment 12 point out). 

But I think it is not the whole story:

> user-written functions in XQuery, XSLT, and XPath are not context-dependent
I assume that you mean by user-written function:
a) xsl:function (XSLT), 
b) FunctionDecl (XQuery) or
c) FunctionBody-function (XP). 

But there is a difference here. XP and XQ "capture" the in-scope local
variables (but not the context), XSLT functions can only access global
variables. In other words, XP and XQ create a closure at definition,
xsl:function does not.

> The focus (context item, context position, and context size) is absentDM31.
This quote is from the current rule 5.b.ii.A. Your proposal mentions
context-dependent vs. non-context-dependent functions, but perhaps a better
split would be between focus-dependent and focus-independent functions, since
it is only the focus that is absent with the "FunctionBody-functions"
(user-defined functions). The rest of the context is available.

> a partial application of F is context-depedendent if F is context-dependent 
> (if I remember correctly...!)
We say about this:

implementation: The implementation of F, associated with the same contexts as
in F. If these contexts are absent in F, it is associated with SC and DC.

Which is, upon re-reading, more ambiguous than I thought. Does "contexts" refer
to DC and SC, or is the plural meant to refer to parts of each context? Esp.
the second line reads as if either the whole context is there or not, then
associate it (associate what, the absent context?).

Can we define this more clearly? (I tried some text proposals, but couldn't
figure it out...)

(In reply to Abel Braaksma from comment #12)
> There is no mention of "external functions" in 2.2.4
(btw: I realize now that "external function" as mentioned in XPath is what is
defined in XQuery as "external function" and in XSLT as "extension function").

You are receiving this mail because:
You are the QA Contact for the bug.

Received on Tuesday, 1 December 2015 16:17:52 UTC