This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 29612 - [FO31] Function argument naming
Summary: [FO31] Function argument naming
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.1 (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows NT
: P2 editorial
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-06 09:27 UTC by Tim Mills
Modified: 2016-07-21 14:58 UTC (History)
0 users

See Also:


Attachments

Description Tim Mills 2016-05-06 09:27:23 UTC
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()*
Comment 1 Tim Mills 2016-05-06 09:32:05 UTC
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()*
Comment 2 Michael Kay 2016-06-06 15:21:03 UTC
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.