This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Looking at the *:for-each functions, it would be nice if the applied function had a consistent name. array:for-each( $array as array(*), $function as function(item()*) as item()*) as array(*) map:for-each( $input as map(*), $action as function(xs:anyAtomicType, item()*)) as item()* fn:for-each($seq as item()*, $f as function(item()) as item()*) as item()*
It would also be nice if array:for-each and map:for-each had matching or consistent names for the first argument. e.g. array:for-each( $input as array(*), $action as function(item()*) as item()*) as array(*) map:for-each( $input as map(*), $action as function(xs:anyAtomicType, item()*)) as item()* or array:for-each( $array as array(*), $action as function(item()*) as item()*) as array(*) map:for-each( $map as map(*), $action as function(xs:anyAtomicType, item()*)) as item()*
I have changed map:keys(), map:size(), and map:for-each() to use $map as the name of the first argument. I have changed map:for-each(), array:for-each(), fn:for-each(), and fn:for-each-pair() to use $action as the name of the function argument. Note: I'm not sure these changes at this stage are really a good idea. There is a grave danger of introducing unnecessary errors, and I'm not at all convinced we should be encouraging readers to think of the argument names as being in any way significant.