Re: fn:slice()

> This is the most confusing explanation so far. In the call above  there are 4 parameters, but none of them counts as a parameter, and they are not provided in the function definition signature...

Calls don't have parameters, they have arguments. Declarations have parameters. In languages that allow keyword arguments, the mapping from arguments to parameters is no longer one-to-one.
> So, one will call the function with any map as parameter and this would be statically OK? 

This is closely aligned with the ability to define options parameters using a record type rather than a generic map. If the parameter is declared with a record type, then we get the potential for much stronger static type checking of function calls than we have had before.
> Is it just me finding this to be a huge disappointment and a huge step backwards.
It seems to me that you have never enjoyed the benefits of working with a language that allows keyword arguments. We found a need in 3.0 and 3.1 to introduce functions such as fn:transform() and fn:serialize() that have highly variable parameter sets; now we're finishing the job by introducing a decent way of calling these functions, with better usabilitty and better type-checking.

Michael Kay

Received on Saturday, 5 December 2020 00:35:19 UTC