[XPath] %variadic("sequence")
does not allow specifying some argument values in the variadic sequence, and in one case even not the variadic sequence itself
#25
Labels
The current specification for sequence variadic functions (at: https://qt4cg.org/branch/master/xquery-40/xpath-40-diff.html#id-static-functions) has the following issues:
This results in difficulties to describe, explain and implement such sequence-variadic functions, and in inability to provide any argument value (like the empty sequence) within the last, sequence argument.
Proposed improvement, which doesn't have the above problems:
Use array-variadic functions instead of sequence-variadic:
%variadic("array")
indicates that the function is array-variadic. An array-variadic function declares one or more parameters, of which the last must be an array. If the declaration includes N parameters, then a call on the function may supply N-1 or more arguments. However, the effective call always consists of N arguments, the first N-1 of which are the values for the positional parameters of the function, and the Nth argument is an array that contains all provided variadic arguments.Why an array-variadic function doesn't have the problems 1 and 2 above?
myFun($posArg1, $posArg2, ..., $posArgN_minus_1, [1, (), 2])
myFun($posArg1, $posArg2, ..., $posArgN_minus_1, [])
The text was updated successfully, but these errors were encountered: