[R6RS] Immutable strings [was: Unicode scalar value escape sequences]

Michael Sperber sperber
Tue Mar 22 08:12:52 EST 2005

>>>>> "Manuel" == Manuel Serrano <Manuel.Serrano at sophia.inria.fr> writes:

Manuel> I don't know if I have a strong opinion. I'm mainly wondering
Manuel> what is there to gain with immutable strings? Allowing string
Manuel> mutations enables, sometime, more efficient
Manuel> implementations. Isn't important?

While I think that mutation proper isn't very frequent, a lot of
strings (at least in my program) are constructed by first allocating
via MAKE-STRING and then filling via STRING-SET!  We'd need to provide
some alternative mechanism for constructing such strings.  (I don't
think LIST->STRING is enough.)  The Haskell people must have suitable
abstractions in their prelude for their immutable arrays, so it's
certainly possible.

In my mind, the answer to this question is tied to the removal of
SET-CAR! and SET-CDR!  Removal of STRING-SET! would certainly break
lots of existing code.

Cheers =8-} Mike
Friede, V?lkerverst?ndigung und ?berhaupt blabla

More information about the R6RS mailing list