[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using libunistring for string comparisons et al
From: |
Mark H Weaver |
Subject: |
Re: Using libunistring for string comparisons et al |
Date: |
Fri, 11 Mar 2011 18:09:13 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) |
I wrote:
> I'm aware that this proposal will be very controversial, but starting in
> Guile 2.2, I think we ought to consider storing strings internally in
> UTF-8, as is done in Gauche. This would of course make string-ref and
> string-set! into O(n) operations. However, I claim that any code that
> depends on string-ref and string-set! could be better written
I guess I better write at least a few more arguments now, before minds
become hardened against it :)
It's a mistake to think of strings as arrays of characters. This is an
adequate model for simple scripts, but not for more complex ones. Even
Gerald Sussman said so in his recent WG1 ballot.
Gerald Sussman wrote in http://trac.sacrideo.us/wg/wiki/WG1BallotSussman
> It is not very good to think of strings as 1-dimensional arrays of
> characters. What about accents and other hairy stuff? Be afraid!
> Consider the complexity of Unicode!
I claim that any reasonable code which currently uses string-ref and
string-set! could be more cleanly written using string ports or
string-{fold,unfold}{,-right}.
Anyway, I don't have time right now to write as persuasive an argument
as I'd like to. After 2.0.1 perhaps I will try again.
Mark
- uc_tolower (uc_toupper (x)), Mark H Weaver, 2011/03/10
- Re: uc_tolower (uc_toupper (x)), Mike Gran, 2011/03/10
- Using libunistring for string comparisons et al, Mark H Weaver, 2011/03/11
- Re: Using libunistring for string comparisons et al, Mark H Weaver, 2011/03/11
- Re: Using libunistring for string comparisons et al,
Mark H Weaver <=
- Re: Using libunistring for string comparisons et al, Ludovic Courtès, 2011/03/12
- Re: Using libunistring for string comparisons et al, Mark H Weaver, 2011/03/12
- Re: Using libunistring for string comparisons et al, Ludovic Courtès, 2011/03/13
- Re: Using libunistring for string comparisons et al, Andy Wingo, 2011/03/30
- O(1) accessors for UTF-8 backed strings, Mark H Weaver, 2011/03/12
- Re: O(1) accessors for UTF-8 backed strings, Alex Shinn, 2011/03/12
- Re: O(1) accessors for UTF-8 backed strings, Mark H Weaver, 2011/03/15
- Re: O(1) accessors for UTF-8 backed strings, Alex Shinn, 2011/03/15
- Re: O(1) accessors for UTF-8 backed strings, Andy Wingo, 2011/03/19
- Re: O(1) accessors for UTF-8 backed strings, Andy Wingo, 2011/03/30