…, however the rules here can be hard to follow at first.
I became curious if this development situation will be improved further.
The other XQuery rule that applies to your examples is that: if there is only one expression in main or a function body then the keyword "return" is omitted
Which specification from the standard does support this implementation detail? https://www.w3.org/TR/2017/REC-xquery-31-20170321/#FunctionDeclns
In your second example, you can define the updating function with let,
This is a general possibility.
Should the shown annotation be replaced by a standard keyword for the function declaration? https://www.w3.org/TR/2011/REC-xquery-update-10-20110317/#id-function-declar...
but calling it requires the use of the updating keyword as described in …
Is this a tool-specific setting? https://docs.basex.org/wiki/XQuery_Update#User-Defined_Functions https://www.w3.org/TR/2011/REC-xquery-update-10-20110317/#id-function-call
Regards, Markus