[Bug 29713] Feature request: add rest parameter

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29713

Abel Braaksma <abel.braaksma@xs4all.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |abel.braaksma@xs4all.nl

--- Comment #5 from Abel Braaksma <abel.braaksma@xs4all.nl> ---
> A function would be identified as a unary one for a single rest parameter.
How would you then differentiate unambiguously between different possible
signatures? With this rule in mind, suppose you have two named functions
declared, same name, like this, but different arities (according to your
rules):

f:test := function($args ... as array(item()?) { return $args[?1] }
f:test := function($x as xs:int, $y as xs:int) {return 1 }

What will f:test(42, 42) return? 42, or 1? And what should f:test#1 return
(function that takes array or function that takes item()?)? And what f:test#2?
Or f:test#99 (i.e., a reference to a function with 99 args, or one with 1 arg
that takes an array, or one with 100 args, with the last one taking an array)?

I'm not saying it is impossible to device the syntax, but there are likely a
lot of cases to consider.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Wednesday, 29 June 2016 12:56:29 UTC