W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2003

Re: "negative count" and unsigned counts

From: Johnny Stenback <jst@w3c.jstenback.com>
Date: Wed, 24 Sep 2003 09:29:23 -0700
Message-ID: <3F71C663.9090206@w3c.jstenback.com>
To: Chris Moschini <cmoschini@myrealbox.com>
Cc: keshlam@us.ibm.com, www-dom@w3.org

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:57 GMT