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

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.

I think there are some important differences between xs:error and 0.  

0 is a  value. It can be assigned to variables and used in expressions.  If xs:error is the result of any operation, it is an error, not a value that can be used in expressions. 

And if I take your analogy seriously, we should allow division by xs:error. I don't think you are suggesting that.  We allow division by zero because we allow division by a numeric value, and don't want to create lots of special cases.  But xs:error is not a value that can occur.

The simplest fix really might be to say that xs:error, used as a SequenceType, is always a type error.  That significantly simplifies specification, test cases, and implementation.

Jonathan

Received on Tuesday, 29 September 2015 12:52:35 UTC