<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>29791</bug_id>
          
          <creation_ts>2016-08-24 09:58:10 +0000</creation_ts>
          <short_desc>[XP31] Non-deterministic with respect to ordering</short_desc>
          <delta_ts>2016-12-16 19:55:14 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Functions and Operators 3.1</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>editorial</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Abel Braaksma">abel.braaksma</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          <cc>andrew_coleman</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>127217</commentid>
    <comment_count>0</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2016-08-24 09:58:10 +0000</bug_when>
    <thetext>(This bug is probably only editorial)

Under 1.7.4 Properties of functions, we state:

&lt;quote&gt;
All functions defined in this specification are ·deterministic· unless otherwise stated. Exceptions include the following:

* Some functions (such as fn:distinct-values and fn:unordered) produce results in an ·implementation-defined· or ·implementation-dependent· order. In such cases there is no guarantee that the order of results from different calls will be the same. These functions are said to be non-deterministic with respect to ordering.
&lt;quote&gt;

I find a few issues with this:

1) neither fn:distinct-values nor fn:unordered have a mention in the body of their resp. entries that they are non-deterministic with respect to ordering

2) the functions map:keys and map:for-each have a mention in the body of their entries, but the line explaining the effect is slightly different with the definition above: &quot;two calls with the same argument are not guaranteed to produce the results in the same order.&quot; versus &quot;no guarantee that the order of results from different calls will be the same.&quot;.

I propose the to bring the sentence in 1.7.4 in line with this, i.e., make it &quot;no guarantee that the order of results from different calls with the same arguments will be the same.&quot;

3) none of fn:distinct-values, fn:unordered, map:for-each and map:keys are marked &quot;non-deterministic&quot; under their resp. properties. I think they should be.

----
I&apos;m not 100% sure that these four functions is an exhaustive list of the non-deterministic wrt ordering functions. For instance, should fn:in-scope-prefixes be in here?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127320</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-09-06 22:04:51 +0000</bug_when>
    <thetext>I have implemented the editorial suggestions here.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>