Rename Number.prototype.clz to Math.clz

Jussi Kalliokoski jussi.kalliokoski at gmail.com
Thu Jan 16 05:01:34 PST 2014


To me this sounds as a good idea, I was actually under the impression that
it would be under Math until I saw the first ES6 draft featuring clz.

Having it under Math not only seems more consistent to me, but also lets
you do nice things like `numbers.map(Math.clz)`.

Cheers,
Jussi

On Wed, Jan 15, 2014 at 11:08 PM, Brendan Eich <brendan at mozilla.com> wrote:

> This is a judgment call, I'm with Jason, I think we should revisit. I'm
> putting it on the TC39 meeting agenda.
>
> /be
>
>  Allen Wirfs-Brock <mailto:allen at wirfs-brock.com>
>> January 15, 2014 11:26 AM
>>
>>
>> So we discussed all that when we made that decision. I understand that
>> you disagree but is there any new data that should cause us to reopen an
>> issue that was already discussed and decided at a TC39 meeting?
>>
>> Allen
>>
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>> Jason Orendorff <mailto:jason.orendorff at gmail.com>
>> January 15, 2014 11:18 AM
>>
>> ES6 adds a clz function, but it's a method of Number.prototype.clz
>> rather than Math.clz.
>>
>> The rationale for this decision is here (search for clz in the page):
>> http://esdiscuss.org/notes/2013-07-25
>>
>> Can we reverse this, for users' sake? The pattern in ES1-5 is quite
>> strong: math functions go on the Math object.
>>
>> The rationale (What if we add a uint64 type?) doesn't seem compelling
>> enough to justify the weirdness of the result: we'll have a single
>> mathematical operation available only as a Number method, and all
>> others available only as Math functions.
>>
>> -j
>>
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>>  _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140116/8d7a4e99/attachment.html>


More information about the es-discuss mailing list