Re: Final draft of Proposed Binary Module

On 19/11/2013 11:01, Christian Grün wrote:
>> I'm inclinded to have two errors: [index-before-start] and [index-after-end]
>> - differentiating between them, which the machine of course can do, makes it
>> easier to track the error - before-start is more likely to be $offset wrong
>> etc.
> I tend to handle semantically similar errors in the same way. As you
> already indicated, before-start is “more likely to be $offset wrong”,
> but as we don’t have any guarantee, both values need to be checked in
> both catch branches to be sure what was going on. Personally, I would
> even treat all out-of-bounds errors (incl. negative-offset and
> negative-size) with a single code for the very same reason; otherwise,
> the resulting XQuery code may get too bloated. What I wouldn’t do,
> however, is to also accept and normalize negative values, as has been
> done in XPath 1.0.
> Just my two (verbose) cents
> Christian
Understood. As Mike pointed out more detailed error information can be 
provided through messages or the error reporting variables. I've changed 
the 'index-before-start'/'index-after-end' to a single 
'index-out-of-range', though a 'size-negative' has been retained 
separately. I have to admit the spec looks a bit 'cleaner'!  The test 
case error codes are being changed accordingly (I'll look through your 
set today.)

*John Lumley* MA PhD CEng FIEE <>
on behalf of Saxonica Ltd

Received on Monday, 25 November 2013 11:52:16 UTC