<?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>29685</bug_id>
          
          <creation_ts>2016-06-04 13:11:46 +0000</creation_ts>
          <short_desc>[FO31] array:put()</short_desc>
          <delta_ts>2016-07-21 13:53:43 +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>All</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>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          <cc>josh.spiegel</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>126671</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-06-04 13:11:46 +0000</bug_when>
    <thetext>I do know that we are past the point of adding new functions because they are a good idea, but in writing an application to make use of arrays recently, I found the absence of array:put() really painful. That is:

array:put($array, $index, $value)

which returns

$array =&gt; array:remove($index) =&gt; array:insert-before($index, $value)

that is, it replaces the value at position $index with a new value.

This seems such a basic omission that I wonder if we should consider it even at this late stage.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126700</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-06-07 17:00:35 +0000</bug_when>
    <thetext>The WG agreed to add this function.

Test cases have been committed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126701</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-06-07 17:16:27 +0000</bug_when>
    <thetext>The function has been added to the spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126707</commentid>
    <comment_count>3</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2016-06-08 15:19:02 +0000</bug_when>
    <thetext>I don&apos;t see it yet, but can you please use the same signature as insert-before?  e.g.

array:put($array as array(*), $position as xs:integer, $member as item()*) as array(*)

i.e. position and member instead of index and value.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>