Unicode support in new ES6 spec draft

Brendan Eich brendan at mozilla.org
Tue Jul 17 15:41:30 PDT 2012


Norbert Lindenberg wrote:
> We agreed in November not to add String.prototype.reverse because there was no compelling use case for it. Is there now?

Thanks, how soon I forgot!

It may be no more compelling case exists now than then. However, Allen 
mentioned forward Unicode-aware iteration over the result of (I'll call 
it) s.reverse() as potentially taking away some of the use-case-based 
need for a Unicode-aware backward iterator.

How common is backward iteration in post-"UCS2" Java, anyone know?

/be
> https://mail.mozilla.org/pipermail/es-discuss/2011-November/018581.html
>
> Norbert
>
>
> On Jul 17, 2012, at 14:49 , Brendan Eich wrote:
>
>> Allen Wirfs-Brock wrote:
>>> On Jul 16, 2012, at 2:57 PM, Mark Davis ☕ wrote:
>>>
>>>> In order to support backwards iteration (which is sometimes used), we should have codePointBefore.
>>> or we can provide a backwards iterator that knows how to parse surrogate pairs:
>>>     for (let c of str.backwards) ...
>>>
>>> Allen
>> Kind of a spin-off, but I think a String.prototype.reverse that avoids
>>
>>   s.split('').reverse().join('')
>>
>> overhead and ES6 Unicode hazard splitting on code unit boundary would be swell. It's tiny and matches Array.prototype.reverse but of course without observable in-place mutation.
>>
>> It wouldn't relieve all use-cases for reverse iteration, but we have iterators and for-of in ES6, we should use 'em.
>>
>> /be
>>>> ------------------------------------------------------------------------
>>>> Mark<https://plus.google.com/114199149796022210033>
>>>> /
>>>> /
>>>> /— Il meglio è l’inimico del bene —/
>>>> //
>>>>
>>> _______________________________________________
>>> 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
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss


More information about the es-discuss mailing list