Re: SRFI 130 - "span" prefix
John Cowan 07 Dec 2015 00:01 UTC
Shiro Kawai scripsit:
> 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".
That's okay as far as it goes, but we'd also need to say that mutating
a string destroys the integrity of any substrings, unless we are going
to require copy-on-write. That's way beyond what can be implemented
portably.
> 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.
It might mess up the hash table (and indeed SRFIs 69, 125, and 126 all
tell you that you can't do that), but not the string itself.
--
John Cowan http://www.ccil.org/~cowan xxxxxx@ccil.org
To say that Bilbo's breath was taken away is no description at all. There are
no words left to express his staggerment, since Men changed the language that
they learned of elves in the days when all the world was wonderful. --The Hobbit