This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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're right - thanks for pointing out this error.
Fixed in the next draft.
For the record, this was not fully/correctly fixed in the Oct 2014 WD, and resurfaces as bug #27231