On 3/15/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> If string-ref also required O(1) time complexity, then you'd be right.
> But it doesn't; it's perfectly fine to implement string-ref on top of
> underlying UTF-8 or UTF-16 character sequences; you just have to settle
> for O(N) performance.

Are you suggesting that indexes represent code points rather than code
units? I haven't seen anyone do that, not as the one-and-only interface to
elements of a string. Have you? And do you think UTF-8/UTF-16
implementations should be *required* to do that? (Obviously, then,
string-length would have to return the number of code points rather than
the number of code units.)


SBCL does that.
http://sbcl.sourceforge.net/sbcl-internals/Character-and-String-Types.html

Wasn't the 16-bit java internal representation chosen before unicode
exhausted the 0-0xffff range? (i.e. it was an unfortunate design
decision)

Alexander

_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to