Changes

Jump to navigation Jump to search
No change in size ,  02:58, 1 March 2012
|-
| valign='top' width='90' | '''Signatures'''
|<code><b>hof:top-k-with</b>($seq as item()*, $lt as function(item(), item()) as xs:boolean, $k as xs:integer, $seq as item()*) as item()*</code>
|-
| valign='top' | '''Summary'''
|Returns the <code>$k</code> items in <code>$seq</code> that are greatest when sorted in the order of the ''less-than'' predicate <code>$lt</code>. The function is a general version of <code>hof:top-k-by($seq, $sort-key, $k, $seq)</code>.
|-
| valign='top' | '''Examples'''
|
* <code>hof:top-k-with(1 to 1000, function($a, $b) { $a lt $b }, 5, 1 to 1000)</code> returns <code>1000 999 998 997 996</code>* <code>hof:top-k-with(-5 to 5, function($a, $b) { abs($a) gt abs($b) }, 5, -5 to 5)</code> returns <code>0 1 -1 2 -2</code>
|}
editor, reviewer
33

edits

Navigation menu