W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2013

Re: IDL: number types

From: Anne van Kesteren <annevk@annevk.nl>
Date: Wed, 20 Mar 2013 12:49:12 -0400
Message-ID: <CADnb78imJ_gP-QFWvC5qMhK6C1rjZZkuxgTB44DbeXSCXQ6RvA@mail.gmail.com>
To: Domenic Denicola <domenic@domenicdenicola.com>
Cc: Marcos Caceres <w3c@marcosc.com>, Boris Zbarsky <bzbarsky@mit.edu>, Yehuda Katz <wycats@gmail.com>, "public-script-coord@w3.org" <public-script-coord@w3.org>
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

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:09 UTC