[Bug 26476] New: Signature of array:fold-right and array:fold-left

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 26476] New: Signature of array:fold-right and array:fold-left

Bugzilla from bugzilla@jessica.w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=26476

            Bug ID: 26476
           Summary: Signature of array:fold-right and array:fold-left
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Functions and Operators 3.1
          Assignee: [hidden email]
          Reporter: [hidden email]
        QA Contact: [hidden email]

Hej,
just looking at the working draft on the array section. I know this is work in
progress. However I’d like to know how the signature of array:fold-right (and
left) is motivated.
Present signature is …

Section 17.3.13 array:fold-right
array:fold-right(
    $array     as array(*),
    $zero     as item()*,
    $function    as function(item()*) as item()*
) as array(*)


I’d expect an array:fold-right to be equivalent to the query:


declare function array:fold-right(
        $array     as array(*),
    $zero     as item()*,
        $function     as function(item()*, item()*) as item()*
) as item()* {
  if (array:size($seq) = 0)
  then $zero
  else $function(array:head($array), fn:fold-right(array:tail($array), $zero,
$function))
};

Hence the signature to be different to the one presently mentioned in the
draft. This signature then would be in analogy to fn:fold-right.

--
You are receiving this mail because:
You are the QA Contact for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug 26476] Signature of array:fold-right and array:fold-left

Bugzilla from bugzilla@jessica.w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=26476

Michael Kay <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #1 from Michael Kay <[hidden email]> ---
You're right - thanks for pointing out this error.

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

Reply | Threaded
Open this post in threaded view
|

[Bug 26476] Signature of array:fold-right and array:fold-left

Bugzilla from bugzilla@jessica.w3.org
In reply to this post by Bugzilla from bugzilla@jessica.w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=26476

Michael Kay <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Michael Kay <[hidden email]> ---
Fixed in the next draft.

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