Re: EXPath Binary module: bin:unpack-integer()

On 3 Oct 2013, at 12:35, Christian Grün wrote:

>> The usual convention in F&O is that "data arguments" allow an empty sequence, and "control arguments" don't. Data arguments are those that can be seen as supplying the data on which the function operates, control arguments as those that qualify what the function does. Of course the distinction is highly subjective.
> 
> Interesting, thanks. When having a look at the bin:or function...
> 
>  bin:or($a as xs:base64Binary, $b as xs:base64Binary) as xs:base64Binary
> 
> ...I would assume that $a is a data argument and $b is a control
> argument. Would you agree?
> 

No, I'd say they are both data arguments (they're symmetric, after all).

An example is

fn:compare($comparand1 as xs:string?, $comparand2 as xs:string?, $collation as xs:string) as xs:integer?

where the comparands are data arguments and the collation is a control argument. Apply the test: how likely is it that this argument would be the value of a node in the source document? (Because that's the case where handling of the empty sequence is useful).

Similarly

fn:matches($input as xs:string?, $pattern as xs:string, $flags as xs:string) as xs:boolean

But as I say, this is ultimately a subjective test, and any attempts to achieve 100% consistency are probably doomed.

Michael Kay
Saxonica

Received on Thursday, 3 October 2013 12:57:14 UTC