On Fri, Dec 4, 2015 at 6:52 AM, Alex Shinn <xxxxxx@gmail.com> wrote:
As I understand, the SRFI is attempting to do two orthogonal things:

1. provide a cursor-oriented API for strings (to account for non-O(1) indexing)
2. provide a cheap substring API (to remove the optional start/end-arg API hell)

Actually, at this moment, we're no more sure if substring is expensive than
if string-set! is cheap.  I mean, we no longer count on string-set! being cheap
on all implementations.  Then why do we need to stick to the conception that
substring is expensive?   I think it should work reverse----if useful code can be
expressed concisely with cheap substring, that would motivate implementations
to adopt such strategy.

We can't immediately drop string-set!, but we can say mutating a string
may invalidate certain structures derived from it (e.g. cursors), or,
"it is an error to mutate a string after it is passed to certain APIs".
Note that the same loose restrictions are already there, e.g. it would be
undefined to mutate a string which is used as a key of hash tables.

We still need separate APIs for charcter-index access and cursor-based
access, but at least we can define them on a single opaque object
which is called string.