Re: IDL: number types

On Wed, Mar 20, 2013 at 12:46 PM, Domenic Denicola
<domenic@domenicdenicola.com> wrote:
>> Well, we would still want a distinction between floating point, integer, non-negative integer, floating point without Infinity, -Infinity, or NaN, ...
>
> Why? JavaScript can't distinguish, so why should WebIDL?

Because specification writers forget these details and giving them
declarative tools to make writing APIs easier is a good thing. You
don't have to think of these things as types, but as a set of initial
constraints on the variable that your algorithm gets passed.


> Or is the idea that properties specified as non-negative integers should have setters that throw when you set them to negative integers or to floating point numbers?

For instance. What exactly we want to do should be in coordination
with TC39 and existing API behavior I think.


-- 
http://annevankesteren.nl/

Received on Wednesday, 20 March 2013 16:49:39 UTC