[Bug 29080] array:members

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29080

Josh Spiegel <josh.spiegel@oracle.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |josh.spiegel@oracle.com

--- Comment #5 from Josh Spiegel <josh.spiegel@oracle.com> ---
I think this function would lead to surprising results in cases where there is
not implicit flattening/atomization.  For example:

  let $arr := [1, 2, (), 4]
  return
    array {
      for $i in array:members($arr)  
      where not(empty($i))
      return 
        $i
    }

I might expect this to filter empty values from the array.  But actually it
would evaluate to [[1],[2],[()],[4]]

You are right that we have made changes recently to the functions and
operators.  We added array:put and modified the signature of array:remove and
map:remove.  In these cases, the modifications were low-risk and
straightforward changes that addressed usability problems.  While I have some
sympathy for the problem you are trying to solve, I am not convinced that this
is the right way to solve the problem. And, as you point out, users can
effectively iterate array members using 1 to array:size().

  let $arr := [1, 2, (), 4]
  return
    array {
      for $i in 1 to array:size($arr)  
      where not(empty($arr($i)))
      return 
        $i
    }

==>

   [1, 2, 4]

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Friday, 10 June 2016 14:37:41 UTC