There are lots of possibilities to implement
strings of characters suchthat the interface can pretend a string
is just a vector of Unicode ScalarValues, while representing most characters
by 8 bits if possible.

One of the alternatives is representing
strings in pieces that arehomogeneous with respect to whether
they use 1, 2, or 3 bytes per char.When string-set! modifies a character
such that its width increases,the string is either split further,
or an entire section of the string is replacedby a wider representation. The access
time becomes O(log |string|),eventually but with very small constants.

This is a matter of personal preference,
but for Scheme I would ratherlike to see more advanced implementations
of strings with a simple interface than simple implementations
with a complicated interface.The most simple interface I can think
of is "string = vector of char".

In fact, I would even prefer if the
default 'string' type in Scheme wouldbehave like a type of constants---exactly
like 'integer' which involves afair amount of magic behind the scene
but is conceptually simple andoften amazingly efficient.