Re: ACTION A-617-01 Jonathan to bring discussion of bug 29119 to the mailing list

> On 29 Sep 2015, at 11:45, Robie, Jonathan <jonathan.robie@emc.com> wrote:
> 
> Mike Kay wrote:
> 
>>> In the query of XPath / XQuery per se, is there ever a need to allow xs:error
>>> as a sequence type?
> 
>> We don’t allow it because there is a use case, we allow it because there is no reason not to. 
>> We don’t disallow multiplication by zero just because we can’t see why anyone would want 
>> to do it. Orthogonality drives the design here: no unnecessary restrictions.
> 
> We disallow it for variable bindings (type error), but allow it for all other uses of sequence type.

I don’t think we “disallow" it, any more than we disallow division by zero.

If you’re referring to the sentence "A variable binding with a type declaration xs:error always raises a type error.” then my interpretation of that sentence is that it’s simply a redundant statement of fact: 

(A) (3.11.1) At run time, if the value bound to the variable does not match the declared type according to the rules for SequenceType matching, a type error is raised [err:XPTY0004].
(B) no value matches the type xs:error
(C) Therefore, if the declared type is xs:error, a type error is raised, whatever the value.

Michael Kay
Saxonica

Received on Tuesday, 29 September 2015 11:56:34 UTC