W3C home > Mailing lists > Public > public-qt-comments@w3.org > April 2013

[Bug 21797] Ordering of parameters in '16.2 Basic higher-order functions'

From: <bugzilla@jessica.w3.org>
Date: Mon, 29 Apr 2013 22:02:40 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-21797-523-zagKVx16pV@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=21797

--- Comment #3 from Michael Kay <mike@saxonica.com> ---
There's a classic example in the spec of a function call that would be more
readable if arguments are reordered. This:

declare function eg:index-of-node($seq as node()*, $search as node()) as
xs:integer* 
{
  fn:for-each-pair(function($node, $index) {
     if($node is $search) then $index else () 
  }, $seq, 1 to fn:count($seq))
}

would become this:

declare function eg:index-of-node($seq as node()*, $search as node()) as
xs:integer* 
{
  fn:for-each-pair(
     $seq,
     1 to fn:count($seq),
     function($node, $index) {
        if($node is $search) then $index else () 
     })
}

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Monday, 29 April 2013 22:02:42 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:52 UTC