Changes

Jump to navigation Jump to search
60 bytes removed ,  18:31, 1 December 2023
m
Text replacement - "</syntaxhighlight>" to "</pre>"
)
};
</syntaxhighlightpre>
|- valign="top"
| '''Examples'''
<syntaxhighlight lang="xquery">
hof:scan-left(1 to 10, 0, function($a, $b) { $a + $b })
</syntaxhighlightpre>
|}
return $item
)[position() <= $k]
</syntaxhighlightpre>
|- valign="top"
| '''Examples'''
$sum-left((1, 1, 1, 1, 1), 1 to 5)
)
</syntaxhighlightpre>
* Another use-case: When inserting a key into a map, {{Code|$f}} decides how to combine the new value with a possibly existing old one. {{Code|hof:const}} here means ignoring the old value, so that's normal insertion.
<syntaxhighlight lang="xquery">
$ins($map, 'foo', 42)('foo')
)
</syntaxhighlightpre>
returns {{Code|3 42}}
|}
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu