Re: Unicode support in new ES6 spec draft

2012-07-23 Thread Norbert Lindenberg
On Jul 19, 2012, at 16:26 , Gillam, Richard wrote: >> I misunderstood how you meant random access - I though you meant truly >> random positions for which you don't know whether they're for the first or >> the second code unit of a code point. It's this kind of randomness that I >> don't expec

Re: Unicode support in new ES6 spec draft

2012-07-19 Thread Gillam, Richard
Norbert-- >> I tend to think so. It seems like I ought to be able to pass some function >> the value 0x1d15f and get back a string containing the quarter-note >> character; otherwise, we're still privileging BMP characters. > > Well, the function that does that is String.fromCodePoint(). The q

Re: Unicode support in new ES6 spec draft

2012-07-19 Thread Norbert Lindenberg
On Jul 18, 2012, at 19:42 , Gillam, Richard wrote: >>> But fromCodeUnit() wouldn't let you pass in values above \x, would it? >> >> True. Is this important enough to application developers to warrant a >> separate method? > > I tend to think so. It seems like I ought to be able to pass so

Re: Unicode support in new ES6 spec draft

2012-07-18 Thread Mathias Bynens
On Tue, Jul 17, 2012 at 10:23 PM, Norbert Lindenberg wrote: >> To further clarify position. I don't currently agree with Norbert's >> assertion WRT "situations". For more discussion see >> https://bugs.ecmascript.org/show_bug.cgi?id=469 >> https://bugs.ecmascript.org/show_bug.cgi?id=525 >> >>

Re: Unicode support in new ES6 spec draft

2012-07-17 Thread Mark Davis ☕
A string reversal is not exactly a high-runner API, and the simple codepoint reversal will have pretty bad results where grapheme-cluster ≠ single code point. -- Mark * * *— Il meglio è l’inimico del bene —* ** On Tue,

Re: Unicode support in new ES6 spec draft

2012-07-17 Thread Brendan Eich
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

Re: Unicode support in new ES6 spec draft

2012-07-17 Thread Norbert Lindenberg
We agreed in November not to add String.prototype.reverse because there was no compelling use case for it. Is there now? 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

Re: Unicode support in new ES6 spec draft

2012-07-17 Thread Brendan Eich
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) ...

Re: Unicode support in new ES6 spec draft

2012-07-17 Thread Norbert Lindenberg
On Jul 16, 2012, at 16:41 , Allen Wirfs-Brock wrote: > > On Jul 16, 2012, at 2:54 PM, Gillam, Richard wrote: > >> Commenting on Norbert's comments… >> ... >>> Careful here. I think we have to treat \uDxxx\uDyyy, where 0x800 ≤ xxx < >>> 0xC00 ≤ yyy ≤ 0xFFF, as a single code point in all situati

Re: Unicode support in new ES6 spec draft

2012-07-17 Thread Norbert Lindenberg
What's the use case for backwards iteration, in the sense of looking at all code points in a string in reverse order? Looking at an individual code point before a given index is necessary, for example, when checking word boundaries, so I can see the need for codePointBefore. Norbert On Jul 1

Re: Unicode support in new ES6 spec draft

2012-07-17 Thread Norbert Lindenberg
And more comments… On Jul 16, 2012, at 14:54 , Gillam, Richard wrote: > Commenting on Norbert's comments… > […] >> We should stay away from the terms "character", "Unicode character", or >> "Unicode scalar value" however. > > Points taken. I'll withdraw my suggestion of "Unicode scalar valu

Re: Unicode support in new ES6 spec draft

2012-07-16 Thread Allen Wirfs-Brock
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 > > Mark > > —

Re: Unicode support in new ES6 spec draft

2012-07-16 Thread Allen Wirfs-Brock
On Jul 16, 2012, at 2:54 PM, Gillam, Richard wrote: > Commenting on Norbert's comments… > ... >> Careful here. I think we have to treat \uDxxx\uDyyy, where 0x800 ≤ xxx < >> 0xC00 ≤ yyy ≤ 0xFFF, as a single code point in all situations. There are >> tools around that convert any non-ASCII charac

Re: Unicode support in new ES6 spec draft

2012-07-16 Thread Mark Davis ☕
In order to support backwards iteration (which is sometimes used), we should have codePointBefore. -- Mark * * *— Il meglio è l’inimico del bene —* ** On Mon, Jul 16, 2012 at 2:54 PM, Gillam, Richard wrote: > Why is i

Re: Unicode support in new ES6 spec draft

2012-07-16 Thread Gillam, Richard
Commenting on Norbert's comments… > Rich's comment was on the lack of any version number for ISO 10646, not on > the Unicode version number. We can simplify the statement in clause 2 to "A > conforming implementation of this Standard shall interpret characters in > conformance with the Unicode

Re: Unicode support in new ES6 spec draft

2012-07-11 Thread Norbert Lindenberg
I haven't reviewed the new spec draft in detail yet, but have some comments on the comments from Rich and Allen - see below. Norbert On Jul 10, 2012, at 20:53 , Allen Wirfs-Brock wrote: > > On Jul 10, 2012, at 7:50 PM, Gillam, Richard wrote: > >> Allen-- >> >> A few comments on the i18n/Uni