Re: Variadic functions and dynamic function calls

I'm now wondering if it makes more sense to have a way of programatically accessing the arguments as an array, like is done in languages like JavaScript. That is, defining a new function:
> 
>     fn:function-arguments($from as xs:integer := 1, $to as xs:integer? := ()) as array(*)
>     (: This function is ·deterministic·, ·context-dependent·, and ·focus-independent·. :)
> 

Yes, I think this makes sense.

Note that we already have a function fn:apply() which supplies the arguments as an array. It's fairly useless in the absence of variadic functions, but could become much more useful in future.

Michael Kay
Saxonica

Received on Thursday, 10 December 2020 18:16:55 UTC