Re: WebIDL

On Sep 25, 2009, at 10:29 PM, Cameron McCormack wrote:

>
> unsigned long doesn’t map exactly to Number.  Assigning a Number to an
> unsigned long attribute does truncation, for example:
>
>  http://dev.w3.org/2006/webapi/WebIDL/#es-unsigned-long
>
> The case could be made for “float”, which maps to Number (apart from
> floats being exactly IEEE 754 singles whereas Number treats all NaNs  
> the
> same).  The type name “float” comes from OMG IDL and is thus already
> familiar to people.  I think it’s a better name for that IDL type  
> (i.e.,
> language binding neutral type) than Number.

JS numbers are IEEE doubles, not singles (modulo the  
indistinguishability of different NaNs and other such details).

>
>> Additionally, it's not a very simple spec to understand. Putting
>> together things like "[Replaceable] readonly" requires some  
>> conceptual
>> work, which makes understanding the HTML5 spec quite difficult.
>
> I agree that’s unintuitive.  Would a different name for the extended
> attribute here help?

For what it's worth, this concept has been called "replaceable" for  
some time in the oral tradition of browser implementors.

Regards,
Maciej

Received on Saturday, 26 September 2009 05:40:57 UTC