Re: "negative count" and unsigned counts

While I agree that a language level exception refering to "index out of 
range" can be used in most (all?) cases in the DOM where unsigned input 
arguments are passed, such an exception can not be thrown in 
non-DOM-specific binding layers such as XPConnect in Mozilla. In such 
cases, the binding layer doesn't know if the argument is an index or 
simply just an unsigned int (used for something other than an index).

Chris Moschini wrote:
> Joseph Kesselman wrote:
> 
>>I believe that clause is there because some bindings
>>-- Java being one of them -- simply do not have the
>>concept of untyped integers.
> 
> 
> But it does have the concept of indices, and it does already have an appropriate Exception to raise:
> 
> IndexOutOfBoundsException
> http://java.sun.com/j2se/1.3/docs/api/java/lang/IndexOutOfBoundsException.html
> 
> If the language does not have the proper typing means to handle the spec, the language should still be called on for resolving this "unsigned" issue rather than the DOM. The Java implementation ought to work around Java's limitation by handling this index as Java already does handle every other index natively - by offering an int argument and throwing an IndexOutOfBoundsException if the argument is negative.
> 
> This would resolve the DOM compliance test issue, as the DOM index exception would no longer be necessary.
> 
> 
> -Chris "SoopahMan" Moschini
> http://hiveminds.info/
> http://soopahman.com/
> 


-- 
jst

Received on Wednesday, 24 September 2003 12:32:53 UTC