[Bug 10721] New: [XPath 2.1] Text for Evaluating Partial Function Applications is imprecise as to when arguments are evaluated, and the set of variable values is wrong.

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

           Summary: [XPath 2.1] Text for Evaluating Partial Function
                    Applications is imprecise as to when arguments are
                    evaluated, and the set of variable values is wrong.
           Product: XPath / XQuery / XSLT
           Version: Member-only Editors Drafts
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XPath 2.1
        AssignedTo: jonathan.robie@redhat.com
        ReportedBy: oliver@cbcl.co.uk
         QAContact: public-qt-comments@w3.org


This also applies to XQuery 1.1

The text from 3.5.1.4 (Evaluating Partial Function Applications) states:


The result of a partial function application of a function or function itemDM11
$f is a single function item $new with the following properties (as defined in
Section 2.7 Function ItemsDM11):

* If $f is a function item, the set of variable values is the same as the
variable values of $f, otherwise it is empty.

* An absent name.

* The function signatureDM11 of $new is the same as $f, removing the parameters
in the positions for which any argument expressions have been provided to the
partial function application. The function arity of $new is the arity of $f
minus the number of argument expressions provided.

* The result of invoking $new is the result of invoking $f with the arguments
from the invocation of $new, inserting any argument expressions from the
partial function application in their respective positions.


XQuery changes this fourth bullet to:


* The result of invoking $new is the result of invoking $f with the arguments
from the invocation of $new, inserting any argument values from the partial
function application in their respective positions.



Clearly we do want to be evaluating the arguments at this point (or at least in
this context), and the partial function application should be storing the
argument values (and not the argument expressions).  However currently we only
compute argument values when making a function call (which this is not).

The fourth bullet states that the result of invoking $new is the result of
invoking $f with particular arguments.  When invoking $f the set of variable
values for $f is necessarily used.  So why does $new inherit the variables of
$f.  $new does not (and cannot) access these variables directly so they are
redundant.


I suggest these two issues can be fixed as so:

Change the first bullet to read:

<new>
* The set of variable values is empty.
</new>

and change the initial text:

<old>
The result of a partial function application of a function or function itemDM11
$f is a single function item $new with the following properties (as defined in
Section 2.7 Function ItemsDM11):
</old>

<new>
The result of a partial function application of a function or function itemDM11
$f is computed as follows:

1. Argument expressions are evaluated, producing argument values, as in step 1.
of [3.1.3.5 Evaluating Function Calls].

2. A single function item $new with the following properties (as defined in
Section 2.7 Function ItemsDM11) is returned:
</new>

The bulleted list should then appear under point 2 in this list.

Finally, the text in the 4th bullet of XPath 2.1 should be updated to match
XQuery 1.1

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Friday, 24 September 2010 13:32:32 UTC