<?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>29333</bug_id>
          
          <creation_ts>2015-12-11 16:48:21 +0000</creation_ts>
          <short_desc>Higher-order functions and updates.</short_desc>
          <delta_ts>2016-03-22 09:53:29 +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>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Christian Gruen">christian.gruen</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          
          
          <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>124421</commentid>
    <comment_count>0</comment_count>
    <who name="Christian Gruen">christian.gruen</who>
    <bug_when>2015-12-11 16:48:21 +0000</bug_when>
    <thetext>In the XQFO spec – or in the XQUF spec? – it should probably be mentioned what is going to happen if an updating function is supplied to a higher-order function. Examples:

  apply(function() { delete node &lt;a/&gt; }, [])

  for-each-pair(
    &lt;a/&gt;,
    &apos;a.xml&apos;,
    function($node, $uri) { fn:put($node, $uri) }
  )

Maybe XPTY0004 could be raised?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124521</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-01-05 15:55:02 +0000</bug_when>
    <thetext>XQuery Update 3.0 states:

A FunctionTest without an updating function assertion only matches simple functions as it does in unextended XQuery 3.0.

The signature of higher-order functions defined in F+O does not include an updating function assertion, and therefore updating functions cannot be supplied as arguments to functions such as apply() and for-each-pair().

Since the spec states that an updating function &quot;is not matched&quot;, I think this implies that XPTY0004 is raised.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124522</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-01-05 16:22:06 +0000</bug_when>
    <thetext>The WG agreed with my response, and decided to close as WORKSFORME. Please re-open if you think we&apos;ve got it wrong.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>