From: Lynn Winebarger <[email protected]> Subject: Re: [r6rs-discuss] Proposed NON-features for small Scheme, part 8: string-set! must die Date: Sat, 19 Sep 2009 20:57:24 -0400
> Your proposal should be broken into two parts. The first is abandoning > the representation of strings as character vectors in favor of data > structures that support faster string operations. The second is the > mandate of immutability. These are two distinct and independent > proposals. > > A better reason for string-copy on an immutable string is to obtain > a mutable string. You can't rule out that some algorithm might > find it useful to share computations about the internal components > of a string. We should distinguish what mutability we're talking. Past RnRS supports mutable strings via string-set! and string-fill!. They are constant-length operations. Some Schemes support length-changing mutable operations. That implies implementation of strings is more than mere fixed-length array of characters. If you argue for "Some algorithm that find it useful to share compuations about the internal components of a string", I think you really want flexible mutation including lenght-changing operaions. I think nobody opposes generally mutable "string-like" data structure, which allows length-changing mutation as well. Immutable-string camp just thinks such data structure can be built on top of immutable primitive strings. Certainly it's a plausible counter argument to claim more flexible primitive strings that allows length-changing mutation. I don't see a benefit, however, to stick to constant-length mutation. --shiro _______________________________________________ r6rs-discuss mailing list [email protected] http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss
