Hello
I once again ran into giving the arguments in wrong order to the
db:replace function. The docs state, that "For historical reasons, the
order of the 2nd and 3rd argument is different to db:add and db:create".
Since XQuery is typed, wouldn't it be possible to add to new "cosmetic"
functions with the arguments in the "right" order like the following:
db:replace($db as xs:string, $input as item(), $path as xs:string) as
empty-sequence()
db:replace($db as xs:string, $input as item(), $path as xs:string,
$options as map(*)?) as empty-sequence()
Since the arguments are typed with different types (xs:string vs item())
this over-loading would work without colliding with the historical and
swapped ones. Am I wrong?
Cheers,
Kristian K