This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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 => array:remove($index) => 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.
The WG agreed to add this function. Test cases have been committed.
The function has been added to the spec.
I don'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.