On Sat, 2009-09-19 at 01:24 -0400, John Cowan wrote:
> This is a proposal for the removal of string-set! (and consequently
> string-fill!) from the R7RS small Scheme language.
While I certainly think that string-set! is in fact unnecessary,
I do not agree that it should be immediately removed. I'd support
moving mutable-strings to a library rather than keeping them in the
core language, but the world is not yet ready for scheme without
mutable strings.
I agree, in principle, that string-set! &co are more problematic,
for several reasons, in a unicode environment.
And functional strings (ie, strings as immutable values) are also
a better fit for multiprocessing, which is becoming more common
in hardware.
In designing a new lisp at this point, I would not (indeed,
did not) include them.
But:
We are not designing a new lisp here. We are standardizing the
next scheme.
There is not a widespread scheme that has no string-set!, nor a
large body of scheme code that is known to run well without it.
If we want to drop a feature that basic, then surely we should
first deprecate it and move it to a library (R7) and second
make the library optional (R8) so that its eventual absence
does not come as a shock to users.
And:
I think that the absence of string mutation would amount to
an attempt to make it hard to write bad code. And my experience
of such attempts is that in practice it makes the bad code
worse. In the case of mutation operators in particular, people
will just write a "portable string-set!" library in terms of
vectors or lists, and then we will have many incompatible kinds
of incompatible strings to go with our many incompatible object
systems.
Scheme has always had as one of its strengths the fact that you
can use it to express many different paradigms of programming,
and I think that taking steps to *reduce* its value for one or
more paradigms is a mistake.
Finally:
The point about strings having formerly enjoyed a 4:1 storage
advantage (8 vs. 32 bits) and 21-bit characters being a better
fit to 32-bit words? Firstly, irrelevant. Small scheme should
be about semantics, not about hardware. Secondly, incorrect.
The primary encoding used by Operating Systems and underlying
libraries is UTF8, which still enjoys a 4:1 storage advantage
for most strings. Thirdly, it's growing more incorrect. Since
new computers these days use 64-bit pointers, the advantage of
packed UTF8 strings over general vectors is rapidly shifting to
8:1.
Bear
_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss